Posts: 2,938
Threads: 162
Joined: May 2010
yep its like strcmp takes 1-3 seconds to respond when u do /pc zcmd responds right away even if you lag very much
e.g zcmd
pawn Код:
CMD:heal(playerid, params[])
{
if(gTeam[playerid] == TEAM_MEDIC)
{
new pid, msg[256];
if(sscanf(params, "u", pid)) return SendClientMessage(playerid, RED, "Usage: '/heal [playerid]'");
if(IsPlayerConnected(pid))
{
SetPlayerHealth(pid, 100);
format(msg, sizeof(msg), "%s has healed you.", ReturnName(playerid));
SendClientMessage(pid, YELLOW, msg);
format(msg, sizeof(msg), "You healed %s.", ReturnName(pid));
SendClientMessage(playerid, YELLOW, msg);
}
else
{
SendClientMessage(playerid, RED, "Player not connected Or Is YourSelf!");
}
}
else
{
SendClientMessage(playerid, RED, "Only Medic's Can Use This Command!");
}
return 1;
}
[e.g teleport]
pawn Код:
CMD:adminbasels(playerid, params[])
{
if(IsPlayerInAnyVehicle(playerid) == 1)
{
SetVehiclePos(GetPlayerVehicleID(playerid),250.0003,-1821.5791,4.0133);
new pvehicleid;
SetVehicleZAngle(pvehicleid, 406);
}
else SetPlayerPos(playerid,250.0003,-1821.5791,4.0133);
return 1;
}
Posts: 791
Threads: 93
Joined: Oct 2009
Reputation:
0
Ok thank you very much...
///-----------------------------
what about unused params? there is needed to define it? (your teleport command)
Posts: 2,938
Threads: 162
Joined: May 2010
well you dont need params for teleport commands param would be used for sscanf
download the zcmd include and sscanf.
for sscanf where you see the "s" or "us" "uis" or whatever,
Код:
c - A character.
d, i - An integer.
h, x - A hex number (e.g. a colour).
f - A float.
s - A string.
z - An optional string.
pX - An additional delimiter where X is another character.
'' - Encloses a litteral string to locate.
u - User, takes a name, part of a name or an id and returns the id if they're connected.
Now has IsNumeric integrated into the code.
Added additional delimiters in the form of all whitespace and an
optioanlly specified one in the format string.