28.03.2015, 13:38
PHP код:
CMD:plus(playerid,params[])
{
if(PlayerInfo[playerid][aLevel] < 1) return SendClientMessage(playerid,RED,"Only admin level 1+ can use this command.");
if(HasSpawned{playerid} == false) return SendClientMessage(playerid, RED, "You must be spawned before you can use this command.");
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, RED, "You cant use this command in a vehicle.");
new coordinate[150], Float:distance, Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
if(sscanf(params, "s[150]f", coordinate, distance)) return SendClientMessage(playerid, RED, "[USAGE]: /plus [x/y/z] [distance]");
if(strfind(coordinate, "x", false) != -1)
{
SetPlayerPos(playerid, x + distance, y, z);
}
else if(strfind(coordinate, "y", false) != -1)
{
SetPlayerPos(playerid, x, y + distance, z);
}
else if(strfind(coordinate, "z", false) != -1)
{
SetPlayerPos(playerid, x, y, z + distance);
}
else
{
SendClientMessage(playerid, RED, "The coord can only be x, y or z.");
}
return true;
}