18.07.2015, 13:35
Hello, I'm trying to make the command /jetpack available for the person who typed it,
and for the Player ID who I want to give him.
Anyone help please?
and for the Player ID who I want to give him.
PHP код:
CMD:jetpack(playerid, params[])
{
new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME], targetid, string[128];
if(pInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[Server]: {7F7F7F} You are not authorized to use this command.");
if(playerid != INVALID_PLAYER_ID)
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[Server]: {7F7F7F} You have spawned jetpack, You can also /jetpack [PlayerID]");
}
else if(sscanf(params, "u", targetid))
{
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFFFFFFFF, "{FF0000}[Server]: {7F7F7F}Player is not connected.");
else
{
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
GetPlayerName(targetid, pName, sizeof(pName));
format(string, sizeof(string), "{FF0000}[Server]: {7F7F7F}You have given %s Jetpack.", pName);
SendClientMessage(playerid, 0xFFFFFFFF, string);
GetPlayerName(playerid, aName, sizeof(aName));
format(string, sizeof(string), "{FF0000}[Server]: {7F7F7F}Admin %s has given you Jetpack", aName);
SendClientMessage(targetid, 0xFFFFFFFF, string);
}
}
return 1;
}