SA-MP Forums Archive
server crash when not giving a reason - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: server crash when not giving a reason (/showthread.php?tid=151217)



server crash when not giving a reason - iStarzz - 29.05.2010

When i am not giving a reason the server crashes, *when i delete part of callremotefunction it works fine..* but this is needed for my irc channel (echo)
pawn Код:
dcmd_explode(playerid, params[])
{
    new explodeid;
    new string[128];
    new reason[128];

    if(UserUD[playerid][admin] > 2 || UserUD[playerid][vip] == 1)
    {
    if(sscanf(params, "uz", explodeid, reason)) return SendClientMessage(playerid,red,"Error: /explode <playerid/name> Reason");
  if(!IsPlayerConnected(explodeid) || explodeid == INVALID_PLAYER_ID || explodeid == playerid)return SendClientMessage(playerid,red,"Error: Player is not connected or it is yourself.");
  if (isnull(reason))
    {
        format(reason, sizeof(reason), "No reason specified");
    }
    format(string,sizeof(string),"%s(id: %d) has exploded %s(id: %d) Reason: %s.",UserUD[playerid][accname],playerid,UserUD[explodeid][accname],explodeid,reason);
    SendClientMessageToAll(adminaction,string);

  format(string, sizeof(string), "%s(id: %d) has exploded %s(id: %d) Reason: %s.",UserUD[playerid][accname],playerid,UserUD[explodeid][accname],explodeid,reason);
    CallRemoteFunction("adminupdate", "sisis",string);

    new Float:x,
        Float:y,
        Float:z;
    GetPlayerPos(explodeid, x,y,z);
    CreateExplosion(x, y, z, 3, 5);
  }
    else
    {
      SendClientMessage(playerid,red,"Error: You are not authorized to use this command.");
    }
    return 1;
}



Re: server crash when not giving a reason - Jefff - 29.05.2010

CallRemoteFunction("adminupdate", "s",string);


Re: server crash when not giving a reason - iStarzz - 30.05.2010

I don't know if this would work, since it has a a string - number - string - number - string