01.07.2012, 15:34
Hey! I created public function to call it from diffrent scripts with CallRemoteFunction, but when it is called it crashes server:
there is nothing written about crash in server log. What can it be?
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;
}