SA-MP Forums Archive
Lil problem - 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: Lil problem (/showthread.php?tid=109385)



Lil problem - Striker_Moe - 19.11.2009

Okay shortґnґsmooth

pawn Код:
dcmd_take(playerid, params[])
{
  if(PlayerInfo[playerid][Level] >= 1)
  {
    new id;
    new epicstring1[128];
    new reportername1[24];
    new reportername2[24];
    GetPlayerName(playerid,reportername1,sizeof(reportername1)); //Admin
    GetPlayerName(id,reportername2,sizeof(reportername2)); //Reporter
    if (strlen(params))
    {
        id = strval(params);
        if (IsPlayerConnected(id))
        {
        SendClientMessage(playerid,green,"[SYSTEM] The player has been notified that you took his report.");
        format(epicstring1, sizeof(epicstring1), "[SYSTEM] Admin %s will care about your report.",reportername1);
        SendClientMessage(id,orange,epicstring1);
        format(epicstring1, sizeof(epicstring1), "[SYSTEM] Admin %s has taken the report on %s",reportername1,reportername2);
        MessageToAdmins(orange,epicstring1);
        }
        else
        {
            SendClientMessage(playerid, 0xFF0000AA, "[SYSTEM] No report found on this ID.");
        }
    }
    else
    {
        SendClientMessage(playerid, 0xFF0000AA, "Usage: /take ID(of the reporter)");
    }
    }
    return 1;
}
id is always displayed as ID 0. Why?


Re: Lil problem - arnutisz - 19.11.2009

new id; this is zero, you need:

new id=strval(params);


Re: Lil problem - ExoSanty - 19.11.2009

new id[128];