14.08.2011, 13:50
can someone gimme codes for /eject,/admins and /adslap <<< for level 1 admins and i've got SF CnR XD
public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(eject, 5, cmdtext);
dcmd(admins, 6, cmdtext);
dcmd(adslap, 6, cmdtext);
return 0;
}
dcmd_eject(playerid, params[])
{
new targetid = strval(params);
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /eject (id)");
else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You're not in a vehicle!");
else if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "Only the player in the driver seat can use this command!");
else if(GetPlayerVehicleID(targetid) != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "That player is not in your vehicle!");
{
RemovePlayerFromVehicle(targetid);
}
return 1;
}
dcmd_admins(playerid, params[])
{
new string[128], name[24];
SendClientMessage(playerid, 0xFF0000AA, "Online Admins");
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i)) //Change to your admin system
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string, "%s", name);
SendClientMessage(playerid, COLOR_UKFGREEN, string);
}
}
return 1;
}
dcmd_adslap(playerid, params[])
{
new string[128], targetid = strval(params);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Only for admins"); //Change IsPlayerAdmin to ur admin system
{
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /adslap (id)");
else if(!IsPlayerConnected(targetid) return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(targetid, X, Y, Z);
GetPlayerPos(targetid, X, Y, Z + 10);
}
}
return 1;
}
dcmd_eject(playerid, params[])
{
new targetid = strval(params);
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /eject (id)");
else if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "You're not in a vehicle!");
else if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFF0000AA, "Only the player in the driver seat can use this command!");
else if(GetPlayerVehicleID(targetid) != GetPlayerVehicleID(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "That player is not in your vehicle!");
{
RemovePlayerFromVehicle(targetid);
}
return 1;
}
dcmd_admins(playerid, params[])
{
new string[128], name[24];
SendClientMessage(playerid, 0xFF0000AA, "Online Admins");
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i)) //Change to your admin system
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s", name);
SendClientMessage(playerid, 0xFF0000AA, string);
}
}
return 1;
}
dcmd_adslap(playerid, params[])
{
new targetid = strval(params);
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF0000AA, "Only for admins"); //Change IsPlayerAdmin to ur admin system
{
if(isnull(params)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /adslap (id)");
else if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, 0xFF0000AA, "Player not found");
{
new Float:X, Float:Y, Float:Z;
GetPlayerPos(targetid, X, Y, Z);
SetPlayerPos(targetid, X, Y, Z + 10);
}
}
return 1;
}
dcmd_admins(playerid, params[]) { new string[128], name[24]; SendClientMessage(playerid, COLOR_BLUE, "Online Admins:"); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) if(AdminLevel(i) == 1) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | Level 1", name); SendClientMessage(playerid, COLOR_RED, string); } if(AdminLevel(i) == 2) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | Level 2", name); SendClientMessage(playerid, COLOR_RED, string); } if(AdminLevel(i) == 3) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | Level 3", name); SendClientMessage(playerid, COLOR_RED, string); } if(AdminLevel(i) == 4) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | Level 4", name); SendClientMessage(playerid, COLOR_RED, string); } if(AdminLevel(i) == 5) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | Level 5", name); SendClientMessage(playerid, COLOR_RED, string); } if(AdminLevel(i) == 1337) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | Level 1337 (Owner)", name); SendClientMessage(playerid, COLOR_RED, string); } if(IsPlayerAdmin(i)) { GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | RCON Admin", name); SendClientMessage(playerid, COLOR_RED, string); } return 1; }
dcmd_admins(playerid, params[])
{
new string[128], name[24], PlayerAdminLevel[19];
SendClientMessage(playerid, COLOR_BLUE, "Online Admins:");
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
switch(AdminLevel(i))
{
case 1: PlayerAdminLevel = "Level 1";
case 2: PlayerAdminLevel = "Level 2";
case 3: PlayerAdminLevel = "Level 3";
case 4: PlayerAdminLevel = "Level 4";
case 5: PlayerAdminLevel = "Level 5";
case 1337: PlayerAdminLevel = "Level 1337 (Owner)";
}
if(IsPlayerAdmin(i))
{
PlayerAdminLevel = "RCON Admin";
}
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s | %s", name, PlayerAdminLevel);
SendClientMessage(playerid, COLOR_RED, string);
}
return 1;
}
new AdminLevel[MAX_PLAYERS];
dcmd_eject(playerid, params[]) { new ID; if(sscanf(params, "u", ID)) { SendClientMessage(playerid,COLOR_ERROR,"USAGE: /eject (Player Name/ID)"); return 1; } if(!IsPlayerInAnyVehicle(playerid)) { SendClientMessage(playerid, COLOR_ERROR, "You're not in a vehicle!"); return 1; } if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { SendClientMessage(playerid, COLOR_ERROR, "Only the player in the driver seat can use this command!"); return 1; } if(GetPlayerVehicleID(ID) != GetPlayerVehicleID(playerid)) { SendClientMessage(playerid, COLOR_ERROR, "That player is not in your vehicle!"); return 1; } RemovePlayerFromVehicle(ID); return 1; } dcmd_admins(playerid, params[]) { #pragma unused params new string[128], name[24], PlayerAdminLevel[19]; SendClientMessage(playerid, COLOR_BLUE, "Online Admins:"); for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) { switch(AdminLevel[i]) { case 1: PlayerAdminLevel = "Level 1"; case 2: PlayerAdminLevel = "Level 2"; case 3: PlayerAdminLevel = "Level 3"; case 4: PlayerAdminLevel = "Level 4"; case 5: PlayerAdminLevel = "Level 5"; case 1337: PlayerAdminLevel = "Level 1337 (Owner)"; } if(IsPlayerAdmin(i)) { PlayerAdminLevel = "RCON Admin"; } GetPlayerName(i, name, sizeof(name)); format(string, sizeof(string), "%s | %s", name, PlayerAdminLevel); SendClientMessage(playerid, COLOR_RED, string); } return 1; } dcmd_adslap(playerid,params[]) { new ID; new string[128]; if(sscanf(params,"ui",ID)) { SendClientMessage(playerid,COLOR_ERROR,"USAGE: /adslap (ID)"); return 1; } if(IsSpawned[ID] == 0) { format(string,sizeof(string),"%s(%d) is must be alive and spawned in order for you to slap them.",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_ERROR,string); return 1; } if(!IsPlayerConnected(ID)) { format(string,sizeof(string),"The Player ID (%d) is not connected to the server.",ID); SendClientMessage(playerid,COLOR_ERROR,string); return 1; } //Playerid format(string,sizeof(string),"You Have Slapped %s(%d).",PlayerName(ID),ID); SendClientMessage(playerid,COLOR_ADMIN,string); //ID GameTextForPlayer(ID,"~r~SLAPPED!!", 3000, 6); new Float:X, Float:Y, Float:Z; GetPlayerPos(ID, X, Y, Z); SetPlayerPos(ID, X, Y, Z + 10); PlayerPlaySound(ID,1190,0,0,0); return 1; }
dcmd(admins,6,cmdtext); dcmd(adslap,6,cmdtext); dcmd(eject,5,cmdtext);