[pomoc]Ar komanda


Započeo Arnel_Bp, Jun 14, 2014, 16:32:49 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Citat: [SF]C++ poslato Jun 14, 2014, 19:11:22 POSLE PODNE
uradicu ti ja samo pojasni sta da sadrzava.
ovaj kod je neuredan.

pa onda ovo sto sam ja probo pokusaj ispraviti... nzm kako da ti ovo obijasnim sad... pogledaj ako mozes ovaj kod sto sam ti dao sto kazes da je neuredan pa ces mozda shvatiti, nzm drugacije kako da ti obijasnim... ili ovaj moj kod ispravi ako ti je lakse..

CMD:ar(playerid, params[])
{
	if(Ulogiran[playerid] == 0) return SendClientMessage(playerid, 0xFF0000FF, "Moras se spawnati da bi mogao da koristis ovu komandu");
   	if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_BOUNTY)
   	{
	new id,string[126];
	if(sscanf(params, "u", id)) return SCM(playerid, 0xFF0000FF, "Koristi: /ar [id]");
	if(!IsPlayerConnected(id)) return SCM(playerid, 0xFF0000FF, "ID igraca koji ste unijeli nije online.");
 	if(IsPlayerInAnyVehicle(id)) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) je u vozilu i nemozes njega uhapsiti. Probaj ga navuci da izadje iz vozila ili pucaj u vozilo",GetName(id),id);
 	if(IsPlayerInAnyVehicle(playerid)) return SCMF(playerid, 0xFF0000FF, "Ne mozes uhapsiti %s(%d) jer si u vozilu, napusti vozilo i pokusaj opet uhapsiti nekoga",GetName(id),id);
 	if(GetDistanceBetweenPlayers(playerid,id) > 4) return SCMF(playerid, 0xFF0000FF, "Igrac %s(%d) je suvise daleko od tebe, probaj mu se pribliziti",GetName(id),id);
    if(Ulogiran[id] == 0) return SCMF(playerid,  0xFF0000FF, "Igrac %s(%d) je mrtav, nemozes uhapsiti njega",GetName(id),id);
    if(Jailed[playerid] ==1) return SCMF(playerid,  0xFF0000FF, "Igrac %s(%d) je vec u zatvoru...",GetName(id),id);
	if(gTeam[playerid] == TEAM_BOUNTY && EscapedConvict[id] == 1 && GetPlayerWantedLevel(id) >=10)
	{
  	SetPlayerInterior(id,10);
    new rnd;
    rnd = random(sizeof (AlcatrazArrestedSpawn));
    SetPlayerPos(id, AlcatrazArrestedSpawn[rnd][0], AlcatrazArrestedSpawn[rnd][1], AlcatrazArrestedSpawn[rnd][2]);
    SetPlayerFacingAngle(id, AlcatrazArrestedSpawn[rnd][3]);
   	new oname[24];
    new pname[24];
    GetPlayerName(playerid,oname, 24);
	GetPlayerName(id, pname, 24);
    format(string, sizeof(string), "Bounty Hunter %s(%d) has re-captured Escaped Convict %s(%d) and has sent the suspect to Alcatraz",oname,playerid,pname,id);
    SendClientMessageToAll(0x00C7FFAA, string);
    SendClientMessage(id, 0xA9A9A9AA, "|_You Have Been Busted By A Bounty Hunter_|");
    format(string, sizeof(string), "You have been sent to Alcatraz by Bounty Hunter %s(%d)",oname,playerid);
    SendClientMessage(id,0x00C7FFAA, string);
    SendClientMessage(id,0x00C7FFAA,"You will be auto-released from Alcatraz once you have served your sentence");
    SendClientMessage(id,0x00C7FFAA,"If Alcatraz life sucks for you... Why not ask a friend to visit you? /reqvisit (id)");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(string, sizeof(string), "You have sent escaped prisoner %s(%d) to Alcatraz - you receive a $5000 re-capture bonus",pname,id);
    SendClientMessage(playerid,0x00C7FFAA, string);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(string, sizeof(string), "Escaped Convict %s(%d) has been re-arrested and sent to Alcatraz by Bounty Hunter %s(%d)",pname,id,oname,playerid);
    printf("%s", string);
    SendClientMessage(id,0xFF7F50AA,"If you leave the server while you are in jail you WILL be banned");
    GivePlayerMoney(playerid,5000);
	Jailed[id] =1;
	InAlcatraz[id] =1;
	triedtoescaperecent[id] =1;
	ResetPlayerWeapons(id);
	JailTime[id] =320;
	JailTimeServed[id] =0;
	EscapedConvict[id] =0;
	SetPlayerWantedLevel(id,0);
	oscore = GetPlayerScore(playerid);
   	SetPlayerScore(playerid, oscore +1);
    if(EscapedConvict[id] == 1 && GetPlayerWantedLevel(id) >=10)
    {
    SetPlayerInterior(id,10);
    rnd = random(sizeof (AlcatrazArrestedSpawn));
    SetPlayerPos(id, AlcatrazArrestedSpawn[rnd][0], AlcatrazArrestedSpawn[rnd][1], AlcatrazArrestedSpawn[rnd][2]);
    SetPlayerFacingAngle(id, AlcatrazArrestedSpawn[rnd][3]);
    format(string, sizeof(string), "Escaped Convict %s(%d) has been re-arrested and sent to Alcatraz by Officer %s(%d) ",pname,id,oname,playerid);
    SendClientMessageToAll(0x00C7FFAA, string);

    SendClientMessage(id, 0xA9A9A9AA, "|_You Have Been Arrested_|");
    format(string, sizeof(string), "You have been sent to Alcatraz by Officer %s(%d)",oname,playerid);
    SendClientMessage(id,0x00C7FFAA, string);
    SendClientMessage(id,0x00C7FFAA,"You will be auto-released from Alcatraz once you have served your sentence");
    SendClientMessage(id,0x00C7FFAA,"If Alcatraz life sucks for you... Why not ask a friend to visit you? /reqvisit (id)");
    SendClientMessage(playerid, 0xA9A9A9AA, "|_Suspect Arrested_|");
    format(string, sizeof(string), "You have sent escaped prisoner %s(%d) to Alcatraz - you receive a $4000 re-capture bonus",pname,id);
    SendClientMessage(playerid,0x00C7FFAA, string);
    GameTextForPlayer(playerid,"~b~Suspect Arrested",5000,3);
    format(string, sizeof(string), "Escaped Convict %s(%d) has been re-arrested and sent to Alcatraz by Officer %s(%d)",pname,id,oname,playerid);
    printf("%s", string);
    GivePlayerMoney(playerid,4000);
	Jailed[id] =1;
	InAlcatraz[id] =1;
	triedtoescaperecent[id] =1;
	ResetPlayerWeapons(id);
	JailTime[id] =320;
	JailTimeServed[id] =0;
	EscapedConvict[id] =0;
	SetPlayerWantedLevel(id,0);
	oscore = GetPlayerScore(playerid);
   	SetPlayerScore(playerid, oscore +1);
	}
	}
	}
	else return SendClientMessage(playerid, 0xFF0000FF, "Ova komanda je namijenjena za oficire San Andreasa.Nisi ovlascen da koristis ovu komandu.");
	return 1;
}

Citat: [SF]C++ poslato Jun 14, 2014, 19:11:22 POSLE PODNE
uradicu ti ja samo pojasni sta da sadrzava.
ovaj kod je neuredan.

znaci kada kucam /ar id da uhapsim nekoga ali to mogu da radim kao fbi, army, cop, i team_bountly, ako je uhapsio team_bountly da pise da ga je on uhapsio ako je neko od fbi,army,cop da pise uhapsen si od officira ovako kao sto je u komandu dato... mada ja cu pokusati da rijesim ovo..

izvoli koncept
YCMD:ar(playerid,params[],help)
{
   new id;
   if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_BOUNTY)
   {
       if(sscanf(params, "u", id)) return SCM(playerid, 0xFF0000FF, "Koristi: /ar [id]");
       if(gTeam[playerid] == TEAM_BOUNTY)
	   {
	   ovde upises uhapseni ste od strane buonty-a itd
	   stavljas mu varijable itd
	   }
	   else if(gTeam[playerid] == TEAM_FBI || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_COP)
	   {
	   ovde stavis da je uhapsen od ova tri tima ili kako oces
	   stavljas mu varijable itd
	   }
   }
   else { SendClientMessage(playerid, 0xFF0000FF, "Ova komanda je namijenjena za oficire San Andreasa.Nisi ovlascen da koristis ovu komandu."); }
   return true;
}
69