14.08.2011, 14:56
Untested, but should work
I guess you use Stevo's SF CnR GM so i made it in dcmd for you
I guess you use Stevo's SF CnR GM so i made it in dcmd for you
pawn Код:
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;
}