pawn Код:
CMD:ant(playerid, params[])
{
if(playerDB[playerid][darbas]!=1) return 0;
new
vardas[MAX_PLAYER_NAME],
msg[64],
policeman[MAX_PLAYER_NAME],
name[MAX_PLAYER_NAME]
;
if( sscanf( params,"z",vardas ) ) return SendClientMessage(playerid,Zalia, "{00CC00}Surakinti ћaidėją: {FF0000}/ant [Vardas_Pavadė]");
new id = GetPlayeridMid(vardas);
if(id == INVALID_PLAYER_ID) return InfoBoxForPlayer(playerid, "~r~Tokio zaidejo nera");
if(id == playerid) return InfoBoxForPlayer(playerid, "~r~Saves surankiti negalite");
new Float:poz[3];
GetPlayerPos(id, poz[0], poz[1], poz[2]);
if(!PlayerToPoint(3, playerid, poz[0],poz[1],poz[2])) return InfoBoxForPlayer(playerid, "~r~Zaidejas per toli");
GetPlayerName(playerid,policeman,sizeof(policeman));
GetPlayerName(id,name,sizeof(name));
if(playerDB[id][surakintas])
{
playerDB[id][surakintas]=false;
TogglePlayerControllable(id,true);
RemovePlayerAttachedObject(id,0);
SetPlayerSpecialAction(id,SPECIAL_ACTION_NONE);
format(msg,sizeof(msg),"{FFD400}Paleidote {DC00FF}%s.",name);
SendClientMessage(playerid,Raudona,msg);
format(msg,sizeof(msg),"{FFD400}Jus paleido {DC00FF}%s.",policeman);
SendClientMessage(id,Raudona,msg);
}
else
{
playerDB[id][surakintas]=true;
TogglePlayerControllable(id,false);
SetPlayerSpecialAction(id, SPECIAL_ACTION_CUFFED );
SetPlayerAttachedObject(id,0,19418,5,0.016000,0.032000,0.025000,17.500005,-10.099991,-48.099990,1.0,1.0,1.0 );
format(msg,sizeof(msg),"{FFD400}Surakinote {DC00FF}%s.",name);
SendClientMessage(playerid,Raudona,msg);
format(msg,sizeof(msg),"{FFD400}Jus surakino {DC00FF}%s.",policeman);
SendClientMessage(id,Raudona,msg);
}
return 1;
}
I can't really find the issue but the way I normally fix these issues is to start commenting out small parts of the script and then tests if the script crashes, you will then be able to find out what line it is that does the crash and do appropriate action according to that.