Posts: 11
Threads: 2
Joined: Jan 2012
Quote:
Originally Posted by Lyksus
There are more efficient ways, you could add it into an enumeration, for example:
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, "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.
|
this will not make it work as long as it doesnt save and nor a fommand that sets the player variable to be able to execute this command yet its a good way but strcmp will save time for you just few linues no saving system required