Some commands
#1

can someone gimme codes for /eject,/admins and /adslap <<< for level 1 admins and i've got SF CnR XD
Reply
#2

What is /eject ... ? /adslap ?
Reply
#3

First of all , write down what you are using. Are you using ZCMD + SSCANF?
Reply
#4

First:Make a enum (called for example Data)//in this enum should be a Admin variable
Second:a global variable called new PlayerData[MAX_PLAYERS][data];
So if you want to make a command you should use if(PlayerData[playerid][variable in the enum( for example Adminlevel) > 1) if the player have a Adminlevel 1 he can use it ,if not he cant
Reply
#5

Quote:
Originally Posted by James_Bourne
Посмотреть сообщение
can someone gimme codes for /eject,/admins and /adslap <<< for level 1 admins and i've got SF CnR XD
wtf, another server with sfcnr gm
btw please be more clear nero, what u want exactly the cmds to do
Reply
#6

Untested, but should work
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;
}
Reply
#7

@Kingunit: sscanf
@CyberOn't work got 5-6 errors.
Reply
#8

What errors do you got?

Edit: nvm
I see it now, try this
pawn Код:
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;
}
Reply
#9

Код:
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;
}
This it right?
Reply
#10

CSJ that should work
Here is an shorter version
pawn Код:
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;
}
Reply
#11

It will give u 4 errors bcuz of script:

it says

Код:
new AdminLevel[MAX_PLAYERS];
So it will not be AdminLevel(i) it will be AdminLevel[i]

That will fix it.
Reply
#12

Cyber and CSJ errorrs! even if i chagned to [i] still 4 errors. + that guy who said wtf one more sf cnr soemthing
/eject id = like kicks out a guy from the vehicle.
/admins = to see if any admins are online
/adslap = its slap id u do that you get slapped.
Reply
#13

Quote:
Originally Posted by James_Bourne
Посмотреть сообщение
Cyber and CSJ errorrs! even if i chagned to [i] still 4 errors. + that guy who said wtf one more sf cnr soemthing
/eject id = like kicks out a guy from the vehicle.
/admins = to see if any admins are online
/adslap = its slap id u do that you get slapped.
ah, lmfao, it is just that there are alot of servers that are hosting this, so it gets alittle boring, and yeah if u ask me dont try to make a replica of jereons server, i would suggest u to try something new and original, i can make all these cmds for u and more through teamviewer, just pm me! thnx
Reply
#14



Longer Version More Described:

Код:
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;
}
Can you understand now?
Reply
#15

lmfao tell him where to add them also
Reply
#16

i've already got help about this.
Reply
#17

Ok and lol? He doesn't know that it's under OnPlayerCommandText? also you had to put in the OnPlayerCommandText

Код:
dcmd(admins,6,cmdtext);
dcmd(adslap,6,cmdtext);
dcmd(eject,5,cmdtext);
Reply
#18

Crazy learn to read this thread is solved.
Reply
#19

I know thast why I said OK and I know how to read mister.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)