Public function crashes server.
#1

Hey! I created public function to call it from diffrent scripts with CallRemoteFunction, but when it is called it crashes server:
pawn Код:
public SpecPlayer(playerid,specid){
        if(Spawned[specid]==false) return SendClientMessage(playerid, COLOR_LIGHTRED, "ERROR: This player is not spawned.");
        SetPlayerInterior(playerid,GetPlayerInterior(specid));
        TogglePlayerSpectating(playerid, 1);
        if(!IsPlayerInAnyVehicle(specid))
        {
        PlayerSpectatePlayer(playerid, specid, SPECTATE_MODE_NORMAL);
        }
        if(IsPlayerInAnyVehicle(specid))
        {
        PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specid), SPECTATE_MODE_NORMAL);
        }
        GetPlayerName(specid, incriminato, sizeof(incriminato)),GetPlayerName(playerid, adminname, sizeof(adminname));
        format(string, sizeof(string), "{00ff00}You're spectating {ffffff}%s", incriminato), SendClientMessage(playerid, COLOR_ZADMINBLUE, string);
        format(string, sizeof(string), "{ffffff}%s {00ff00}is spectating you", adminname), SendClientMessage(specid, COLOR_ZADMINBLUE, string);
        return 1;
        }
there is nothing written about crash in server log. What can it be?
Reply
#2

Show how you call it.
Reply
#3

if(listitem == 2)
{
CallRemoteFunction( "SpecPlayer", "ds", playerid,clicked[playerid]);
}
Reply
#4

Should be

pawn Код:
CallRemoteFunction( "SpecPlayer", "dd", playerid,clicked[playerid]);
Reply
#5

thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)