03.04.2010, 20:27
Hello!
I wanna ask, what is better: function strtok or sscanf. I want to ask also what is dcmd .
I wanna ask, what is better: function strtok or sscanf. I want to ask also what is dcmd .
C:\Users\Computer\Desktop\Server\gamemodes\CrazyStunts.pwn(82) : warning 203: symbol is never used: "heal"
command(heal,playerid,params[]) { new User; if(!sscanf(params,"u",User)) { SetPlayerHealth(User, 100); } else return SendClientMessage(playerid,0x0000FF,"(USAGE): /Heal (Player ID)"); return 1; }
dcmd_heal(params[],playerid);
heal(playerid,params[])
{
new User;
if(!sscanf(params,"u",User))
{
SetPlayerHealth(User, 100);
}
else return SendClientMessage(playerid,0x0000FF,"(USAGE): /Heal (Player ID)");
return 1;
}
COMMAND:heal(playerid, params[])
{
......
}
COMMAND:heal(playerid, params[])
{
new giveplayerid;
if(!sscanf(params,"u",giveplayerid)) {
SetPlayerHealth(playerid,100.0);
} else {
if(IsPlayerConnected(giveplayerid)) {
SetPlayerHealth(giveplayerid,100.0);
}
}
return 1;
}
Originally Posted by _Jay_
Note that strtok isn't that slow. If you prefer it, use it. A lot of people exaggerate theoretical performance without even benchmarking it themselves in the first place.
|