09.02.2014, 01:18
Try this:
PHP код:
CMD:jetpack(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 2 && PlayerInfo[playerid][pAdmin] < 4) {
JetPack[playerid] = 1;
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
return 1;
}
new string[128], plo;
if(sscanf(params, "u", plo)) {
SendClientMessageEx(playerid, COLOR_GRAD2, "USAGE: /jetpack [playerid]");
return 1;
}
if (IsPlayerConnected) {
if(plo != INVALID_PLAYER_ID) {
if (PlayerInfo[playerid][pAdmin] >= 4) {
SendClientMessageEx(plo, COLOR_GRAD1, "Jetpack Given!");
JetPack[plo] = 1;
SetPlayerSpecialAction(plo, SPECIAL_ACTION_USEJETPACK);
format(string, sizeof(string), "[TDM]: %s has received a jetpack from %s", GetPlayerNameEx(plo), GetPlayerNameEx(playerid));
SendClientMessageToAllEx(COLOR_LIGHTRED, string);
}
else {
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
}
}
}
else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
return 1;
}
return 1;
}