16.09.2012, 13:40
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 ?
how can im make giveplayerid function ?
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
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 ? |
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;
}
Use sscanf.
an example to use Giveplayerid with it. pawn Код:
|
pawn Код:
|
C:\Users\pcx\Desktop\CopsSystem.pwn(89) : error 017: undefined symbol "taze"
C:\Users\pcx\Desktop\CopsSystem.pwn(95) : error 017: undefined symbol "params"
C:\Users\pcx\Desktop\CopsSystem.pwn(107) : warning 225: unreachable code
C:\Users\pcx\Desktop\CopsSystem.pwn(89) : warning 203: symbol is never used: "CMD"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
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;
}
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;
}
#include <a_samp>
#include <sscanf2>
#include <zcmd>