Please help me with this jail 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Please help me with this jail command (
/showthread.php?tid=175232)
Please help me with this jail command -
zack3021 - 08.09.2010
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;
}
}
Re: Please help me with this jail command -
Conroy - 08.09.2010
pId is not assigned a value. It will be 0, hence why it's only playerid 0 (you) who is jailed.
Re: Please help me with this jail command -
zack3021 - 08.09.2010
So how can i assign a value to it?
Re: Please help me with this jail command -
zack3021 - 09.09.2010
Guys help me plz.