SA-MP Forums Archive
Command - 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)
+--- Thread: Command (/showthread.php?tid=286727)



Command - Chris_Morrison - 30.09.2011

Hi
i need command to /setlevel that will set player [pConnectTime]
My /setstat is bugged and won't work so i need this command
Thanks a lot!
the helper will gain +Rep!


Re: Command - Xyrex - 30.09.2011

Not checked.

pawn Код:
if(strcmp(cmd, "/setlevel", true) == 0)
{
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /setlevel [playerid/PartOfName] [amount]");
                return 1;
            }
            new userid;
            new level;
            userid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(IsPlayerConnected(userid))
            {
                if(userid != INVALID_PLAYER_ID)
                {
                    //Change that
                    PlayerInfo[userid][pConnectTime] = level;
                }
           
            }
        }
        return 1;
}



Re: Command - Kush - 30.09.2011

Quote:
Originally Posted by Xyrex
Посмотреть сообщение
Not checked.

pawn Код:
if(strcmp(cmd, "/setlevel", true) == 0)
{
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /setlevel [playerid/PartOfName] [amount]");
                return 1;
            }
            new userid;
            new level;
            userid = ReturnUser(tmp);
            tmp = strtok(cmdtext, idx);
            level = strval(tmp);
            if(IsPlayerConnected(userid))
            {
                if(userid != INVALID_PLAYER_ID)
                {
                    //Change that
                    PlayerInfo[userid][pConnectTime] = level;
                }
           
            }
        }
        return 1;
}
Stop ripping stuff!