Please help me with this jail command
#1

Ok when i type /jail the id here] it puts me in jail, but when another player does it, it works fine.

Код:
COMMAND:jail(playerid,params[])
{   new pskin = GetPlayerSkin(playerid);
    if(pskin == 265 || pskin == 266 || pskin == 267 || pskin == 280 || pskin == 281 || pskin == 284 || pskin == 285 || pskin == 286 || pskin == 287 || pskin == 288)

    if(IsPlayerConnected(playerid))
    {
        new pId;

         if(!IsPlayerConnected(pId)) return SendClientMessage(playerid, 0xFF0000AA, "The ID You Entered Was Not Found.");
                else
                {
                    new rand = random(sizeof(JailCellSpawns));
                    SetPlayerPos(pId, JailCellSpawns[rand][0], JailCellSpawns[rand][1], JailCellSpawns[rand][2]);
                    new rand1 = random(sizeof(JailCellSpawns1));
                    SetPlayerPos(pId, JailCellSpawns1[rand1][0], JailCellSpawns1[rand1][1], JailCellSpawns1[rand1][2]);
                    if(GetPlayerWantedLevel(pId) > 3) return SetTimerEx("Unjail",2000,false,"i",pId);
                    InJail[pId] = 1;
                    SetPlayerWantedLevel(pId, 0);
                    return 1;
                }
               }
               else if(GetPlayerSkin(playerid)) return SendClientMessage(playerid,0xFF0000FF,"You dont have permisson to acces this command");
    {
                       return 0;
            }
}
Reply
#2

pId is not assigned a value. It will be 0, hence why it's only playerid 0 (you) who is jailed.
Reply
#3

So how can i assign a value to it?
Reply
#4

Guys help me plz.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)