if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster] == 0) return SCM(playerid, GREY, "Not Allowed.");
if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster] < 2) return SCM(playerid, GREY, "Not Allowed.");
if(PI[playerid][Admin] >= 1)
if(PI[playerid][Admin] == 6 && PI[playerid][GameMaster] == 0 || 1 || 2 || 3 || 4 || 5)
{
//Means player is admin level 6 and Gamemaster level 0 or 1, or 2 or 3 or 4 or 5
}
else
{
//Player is either not admin lvl 6 or not gamemaster lvl 1,2,3,4,5
}
if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster] == 0) return SCM(playerid, GREY, "Not Allowed.");
if(PI[playerid][Admin] == 6 && PI[playerid][GameMaster] == 0 || 1 || 2 || 3 || 4 || 5)
CMD:goto(playerid, params[])
{
if(LoggedIN[playerid] == 0) return SCM(playerid, GREY, "YOu have to be logged-in first.");
new id, veh = GetPlayerVehicleID(playerid), Float:X, Float:Y, Float:Z;
if(PI[playerid][Admin] == 0 || PI[playerid][GameMaster]) return SCM(playerid, GREY, "Not allowed.");
if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Use: /goto [ID / Part of Name]");
if(!IsPlayerConnected(id)) return SCM(playerid, GREY, "That player is not online.");
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(id, X, Y, Z);
SetVehiclePos(veh, X, Y+2, Z);
LinkVehicleToInterior(veh, GetPlayerInterior(id));
SetPlayerVirtualWorld(veh, GetPlayerVirtualWorld(id));
}
else
{
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(playerid, X, Y+2, Z);
SetPlayerInterior(playerid, GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
}
SCM(playerid, GREY, "You have been teleported.");
return 1;
}
CMD:goto(playerid, params[])
{
if(LoggedIN[playerid] == 0) return SCM(playerid, GREY, "YOu have to be logged-in first.");
new id, veh = GetPlayerVehicleID(playerid), Float:X, Float:Y, Float:Z;
if(!PI[playerid][Admin] || !PI[playerid][GameMaster]) return SCM(playerid, GREY, "Not allowed.");
if(sscanf(params, "u", id)) return SCM(playerid, GREY, "Use: /goto [ID / Part of Name]");
if(!IsPlayerConnected(id)) return SCM(playerid, GREY, "That player is not online.");
if(IsPlayerInAnyVehicle(playerid))
{
GetPlayerPos(id, X, Y, Z);
SetVehiclePos(veh, X, Y+2, Z);
LinkVehicleToInterior(veh, GetPlayerInterior(id));
SetPlayerVirtualWorld(veh, GetPlayerVirtualWorld(id));
}
else
{
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(playerid, X, Y+2, Z);
SetPlayerInterior(playerid, GetPlayerInterior(id));
SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
}
SCM(playerid, GREY, "You have been teleported.");
return 1;
}
You don't understand. For example in this command, admin have to be level 1 or greater to use this command, or if player is not an admin he has to be GameMaster level 1 or greater, and if player is not admin or game master he can't use this command at all..
pawn Код:
|