Jump to content
  • 0

pomoc problem


Guest jirbate

Dotaz

hele lidi mě jde už jail ale mam problem když nekoho zatknu a chci ho osvobodit tak mi napíše že nejsem polda a musim se přihlasit znovu za poldu co stim?

if(strcmp(cmd, "/jail", true) == 0){

new zatknout;

// new dir[256];

if (iPlayerRole[playerid] == 6 || iPlayerRole[playerid] == 7|| iPlayerRole[playerid] == 8)

{

tmp = strtok(cmdtext, idx);

 

if(!strlen(tmp)) { // co se stane kdyz napise /jail bez ID

SendClientMessage(playerid, COLOR_WHITE, "POUZIJ: /jail [iD]");

return 1;

}

zatknout = strval(tmp);

if(!IsPlayerConnected(zatknout)){ // kdz ID neexistuje

SendClientMessage(playerid, COLOR_RED, "Spatne ID!");

return 1;

}

 

GetPlayerName(zatknout, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "Parmen %s byl zatknuty poldou %s.", giveplayer, sendername);

SendClientMessageToAll(COLOR_LIGHTBLUE, string);

jailed[zatknout]=1; // nastavi hraci promenou jailed hodnotu 1

iPlayerRole[playerid]=0; // aby hrac nemel zadne povolani..pochopitelne muzete smazat tento radek

SetPlayerColor(zatknout, COLOR_RED);

ResetPlayerWeapons(zatknout);

printf(string);

SetPlayerInterior(zatknout,3);

SetPlayerPos(zatknout,198.3797,160.8905,1003.0300); // souradnice veznice

}else{

 

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Musis byt polda"); // text co se stane kdyz nema if pod new dir[256];

}

 

return 1;

}

if(strcmp(cmd, "/unjail", true) == 0){

new unzatknout;

tmp = strtok(cmdtext, idx);

if (iPlayerRole[playerid] == 6)

{

 

if(!strlen(tmp)) {

SendClientMessage(playerid, COLOR_WHITE, "POUZITI: /unjail [iD]");

return 1;

}

unzatknout = strval(tmp);

if(!IsPlayerConnected(unzatknout)){

SendClientMessage(playerid, COLOR_RED, "Hrac neni pripojen!");

return 1;

}

if (jailed[unzatknout] == 1) { // hrac musi byt ve vezeni ...

GetPlayerName(unzatknout, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "Policista %s propustil hrace %s z vezeni!", sendername,giveplayer);

SendClientMessageToAll(COLOR_LIGHTBLUE, string);

jailed[unzatknout]=0;

printf(string);

SetPlayerPos(unzatknout,267.3461,77.7873,1001.0391); //souradnice kam chcete aby byl propusteny warpnut

GameTextForPlayer(unzatknout,"~r~Byl jsi propusten z vezeni policistou!.",5000,1);

return 1;

 

}else{

GetPlayerName(unzatknout, giveplayer, sizeof(giveplayer));

format(string, sizeof(string), "Hrac %s neni ve vezeni!.", giveplayer);

SendClientMessage(playerid, COLOR_RED, string);

}

}else{

 

SendClientMessage(playerid, COLOR_LIGHTBLUE, "Musis byt polda");

}

 

return 1;

}

Link to comment
Share on other sites

8 odpovědí na tuto otázku

Recommended Posts

  • 0

vyřešeno if (iPlayerRole[playerid] == 3 || iPlayerRole[playerid] == 4 || iPlayerRole[playerid] == 4) sme zmenili na if (iPlayerRole[playerid] == 3 || iPlayerRole[playerid] == 4 || iPlayerRole[playerid] == 5) chyba v povolani

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...