SA-MP Forums Archive
Can't solve it please help . - 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: Can't solve it please help . (/showthread.php?tid=180305)



Can't solve it please help . - Scriptissue - 30.09.2010

I made a new Ajail script and it seems like I can't use it on another players If I try to jail another ID it automatically Ajails me, I tried to compare with another scripts, or check for tutorials but I could find anything, please help me.
PHP код:
CMD:ajail(playeridparams[])
{
if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid0xFF4646FF"You are not authorized to use that command !");
else
{
  new 
otherId;
  new 
sendername[MAX_PLAYER_NAME];
  new 
giveplayer[MAX_PLAYER_NAME];
  new 
string[256];
  if(
sscanf(params"u"otherId)) return SendClientMessage(playerid0xAFAFAFAA"USAGE: /ajail [PlayerID/PartOfName] [Time(minutes)] [Reason]");
  
format(stringsizeof(string), "* You Jailed %s."giveplayer);
  
SendClientMessage(playeridCOLOR_LIGHTREDstring);
 if(
otherId == INVALID_PLAYER_ID) return SendClientMessage(playerid0xAFAFAFAA"Invalid Player ID");
   {
new 
Float:xFloat:yFloat:z;
GetPlayerPos(playeridxyz);
SetPlayerPos(playerid,1769.37341309,178.79183960,1369.28161621);
format(stringsizeof(string), "* You been Admin jailed by Admin %s "sendername );
                
SendClientMessage(playerid0xFF4646FFstring);
}
        }
    return 
1;




Re: Can't solve it please help . - [XST]O_x - 30.09.2010

pawn Код:
SetPlayerPos(playerid,1769.37341309,178.79183960,1369.28161621);
You're setting the position of who typed the command.

pawn Код:
SetPlayerPos(otherId,1769.37341309,178.79183960,1369.28161621);



Re: Can't solve it please help . - Sascha - 30.09.2010

Replace the " playerid" with otherID at the "SetPlayerPos"... also You can remove thw "getplayerpos"


Re: Can't solve it please help . - Scriptissue - 30.09.2010

Thanks it works,