25.12.2011, 05:07
pawn Код:
if(strcmp(cmd, "/up", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /up [amount]");
return 1;
}
new pos;
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
pos = strval(tmp);
new Float:X, Float:Y, Float:Z;
new vehicleid = GetPlayerVehicleID(playerid);
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInAnyVehicle(playerid))
{
SetVehiclePos(vehicleid, X, Y, Z+pos);
SendClientMessage(playerid,COL_ADMIN,"** Moved up 50 feet.");
}
else
{
SetPlayerPos(vehicleid, X, Y, Z+pos);
SendClientMessage(playerid,COL_ADMIN,"** Moved up 50 feet.");
return 1;
}
}
else
{
SendClientMessage(playerid,COLOR_GRAD3,"You are not authorised to use this command.!");
return 1;
}
}