GivePlayerID
#1

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 ?
Reply
#2

Set a players ID? Not possible.

If not, what does this function do?
Reply
#3

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.
Reply
#4

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 ?
Reply
#5

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;
}
Reply
#6

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 !
Reply
#7

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;
   } 
Reply
#8

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?
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 3 Guest(s)