15.08.2013, 01:56
There are more efficient ways, you could add it into an enumeration, for example:
Also, "SendClientMessageForAll" would not return playerid's as it send it to all, so just use (color, "nabba")
Also when you use "Format" and you've defined a size before it, instead of defining the limit on the format, just use sizeof(string).
Hope I helped
Use ZCMD, just look it up and you'll find it.
Hope it helped.
pawn Код:
#include <zcmd> // just do it, d_cmd is slow as s**t
enum pInfo
{
//whatever your enums are
UnrestrictedStunt
}
new PlayerInfo[MAX_PLAYERS][pInfo]
CMD:stunt(playerid, params[])
{
if(PlayerInfo[playerid][UnrestrictedStunt] == 1) // if he is allowed to go there
{
new name[24], string[128];
if(IsPlayerInAnyVehicle(playerid) %% GetPlayerState(playerid) == 2)
{
new vehid = GetPlayerVehicleID(playerid);
SetVehiclePos(vehid, 3362.1589355469, -2069.42578125, 46.729736328125);
PutPlayerInVehicle(playerid, vehid, 0);
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "{00FFEE}%s (%d){C9FFAB} ..::has gone to do some stunt::..{6600FF}(/STUNT)", name, playerid);
SendClientMessageToAll(-1, string);
}
else return SendClientMessage(playerid, -1, "You are not authorized to use this!");
}
return 1;
}
Also when you use "Format" and you've defined a size before it, instead of defining the limit on the format, just use sizeof(string).
Hope I helped
Use ZCMD, just look it up and you'll find it.
Hope it helped.