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



GivePlayerID - Dixon_Smith - 16.09.2012

Someone Can Show Me How can im do cmmand with giveplayerid, im mean i want do cmmand on some player ..
how can im make giveplayerid function ?


Re: GivePlayerID - C00K13M0N$73R - 16.09.2012

Set a players ID? Not possible.

If not, what does this function do?


Re: GivePlayerID - AtItsMax - 16.09.2012

Use sscanf.
an example to use Giveplayerid with it.
pawn Код:
CMD:mycommand(parameters) // our command
{ // starting bracket
new thisisplayerid,money; // NOTE: thisisplayerid is used as an example
if(sscanf(params,"ud",thisisplayerid,money)) return SendClientMessage(playerid,-1,"/mycommand [giveplayerid] [moniez]"); // our sscanf example, you can use this to apply function on players.
GivePlayerMoney(playerid,money); // Gives the specified playerid the money you write in /mycommand [giveplayerid] [money]
return 1; // returns true
} // close of bracket
I hope this explains you the usage of giveplayerid.


Re: GivePlayerID - Dixon_Smith - 16.09.2012

Quote:
Originally Posted by C00K13M0N$73R
Посмотреть сообщение
Set a players ID? Not possible.

If not, what does this function do?
hhhh no bro, im mean for exemple i want put handcuffs on player but no me on difrrend player do it like that :
/cuff [Player ID]
Understand ?


Re: GivePlayerID - AtItsMax - 16.09.2012

Quote:
Originally Posted by Dixon_Smith
Посмотреть сообщение
hhhh no bro, im mean for exemple i want put handcuffs on player but no me on difrrend player do it like that :
/cuff [Player ID]
Understand ?
pawn Код:
CMD:cuff(playerid,params[])
{
new cuffedid; // defining the id which will be cuffed.
if(sscanf(params,"u",cuffedid)) return Sendclientmessage(playerid,-1,"/cuff [playerid]"); // use of sscanf
CuffHim(cuffedit); // your cuffing player function
SendClientMessage(cuffedid,"you have been cuffed"); // sends the cuffed player the message
return 1;
}



Re: GivePlayerID - Dixon_Smith - 16.09.2012

Quote:
Originally Posted by AtItsMax
Посмотреть сообщение
Use sscanf.
an example to use Giveplayerid with it.
pawn Код:
CMD:mycommand(parameters) // our command
{ // starting bracket
new thisisplayerid,money; // NOTE: thisisplayerid is used as an example
if(sscanf(params,"ud",thisisplayerid,money)) return SendClientMessage(playerid,-1,"/mycommand [giveplayerid] [moniez]"); // our sscanf example, you can use this to apply function on players.
GivePlayerMoney(playerid,money); // Gives the specified playerid the money you write in /mycommand [giveplayerid] [money]
return 1; // returns true
} // close of bracket
I hope this explains you the usage of giveplayerid.
Im Know With sscanf but i doesnt want work with this include, have another way to do this !


Re: GivePlayerID - Dixon_Smith - 16.09.2012

Quote:
Originally Posted by AtItsMax
Посмотреть сообщение
pawn Код:
CMD:cuff(playerid,params[])
{
new cuffedid; // defining the id which will be cuffed.
if(sscanf(params,"u",cuffedid)) return Sendclientmessage(playerid,-1,"/cuff [playerid]"); // use of sscanf
CuffHim(cuffedit); // your cuffing player function
SendClientMessage(cuffedid,"you have been cuffed"); // sends the cuffed player the message
return 1;
}
Im Doesnt use that but if yes I have this erors :

PHP код:
C:\Users\pcx\Desktop\CopsSystem.pwn(89) : error 017undefined symbol "taze"
C:\Users\pcx\Desktop\CopsSystem.pwn(95) : error 017undefined symbol "params"
C:\Users\pcx\Desktop\CopsSystem.pwn(107) : warning 225unreachable code
C
:\Users\pcx\Desktop\CopsSystem.pwn(89) : warning 203symbol is never used"CMD"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

The Lines :
PHP код:
   CMD:taze(playerid,params[])
   {
      if(
HandCuffs[playerid] == 1)
      {
         if(
HandCuffsTazed[playerid] == 1)
         {
           if(
sscanf(params,"u",tazed))
           {
           new 
Float:Health;
           
GetPlayerHealth(playerid,Health);
           
SetPlayerHealth(playerid,Health-5);
           
SetTimerEx("TazedTimer",12000,false,"d",playerid);
           
SetTimerEx("TazedStop",19700,false,"d",playerid);
           }
         }
      }
      return 
1;
   } 



Re: GivePlayerID - AtItsMax - 16.09.2012

pawn Код:
CMD:taze(playerid,params[])
   {
      new tazed;
      if(HandCuffs[playerid] == 1)
      {
         if(HandCuffsTazed[playerid] == 1)
         {
           if(sscanf(params,"u",tazed))
           {
           new Float:Health;
           GetPlayerHealth(playerid,Health);
           SetPlayerHealth(playerid,Health-5);
           SetTimerEx("TazedTimer",12000,false,"d",playerid);
           SetTimerEx("TazedStop",19700,false,"d",playerid);
           }
         }
      }
      return 1;
   }
And are you sure you have zcmd include defined? what command processor you use?


Re: GivePlayerID - Lordzy - 16.09.2012

Include zcmd.
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>



Re: GivePlayerID - Dixon_Smith - 16.09.2012

My Mistake Im Fix It, But Im Dont like This Way Please Give Me AnotherWay ..