#1

Right I need help with a couple things

1. Is it createobject and moveobject to make something like a barrier open with a command?

2. Anyone show me how to add admin ranks instead of the level number....

Any help will be much appreciated, Thank you.
Reply
#2

1.Yes
2.Just write something like this
Код:
 GetAdminName(playerid)
{
	new adminname[128];
	switch(pInfo[playerid][pAdminLevel]) <YOUR OWN VARIABLE HERE>
	{
		case 0: adminname = "Not Admin";
		case 1: adminname = "Trial Moderator";
		case 2: adminname = "Moderator Team";
		case 3: adminname = "Administrator Team";
		case 4: adminname = "Support Team";
		case 5: adminname = "Management Team";
		case 6: adminname = "Developer Team";
		case 7: adminname = "Community Owner";
	}
	return adminname;
}
Reply
#3

Could you show me an example of the moveobject code for a faction?
Reply
#4

Well, there are plenty of tutorials about moving gates, you could look at those tutorials and try making one yourself. But for making the barrier opening/closing like in real life (or in single player's LSPD barrier) you have to do a small trick, using a timer of 0.5 to move the object and slightly changing the rotation of the object while moving it would make the barrier open/close smoothly.
Reply
#5

C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\core.pwn(2940) : error 010: invalid function or declaration
C:\Program Files (x86)\Rockstar Games\GTA San Andreas\gamemodes\core.pwn(4754) : warning 203: symbol is never used: "GetAdminName"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

I tried that getadminname thing and this is what i got
help please?
Reply
#6

PHP код:
stock GetAdminName(playerid)
{
    new 
adminname[128];
    switch(
pInfo[playerid][pAdminLevel]) 
    {
        case 
0adminname "Not Admin";
        case 
1adminname "Trial Moderator";
        case 
2adminname "Moderator Team";
        case 
3adminname "Administrator Team";
        case 
4adminname "Support Team";
        case 
5adminname "Management Team";
        case 
6adminname "Developer Team";
        case 
7adminname "Community Owner";
    }
    return 
adminname;

When you use "stock" before this function you won't get this mistake.

Can you show us the code of the another mistake or do you want solve this yourself.
Reply
#7

Improved version

PHP код:
new const admin_names_array[][]=
{
    
"Not Admin",
    
"Trial Moderator",
    
"Moderator Team",
    
"Administrator Team",
    
"Support Team",
    
"Management Team",
    
"Developer Team",
    
"Community Owner"
};
#define GetAdminName(%0) admin_names_array[pInfo[%0][pAdminLevel]] 
Reply
#8

for me I use.
PHP код:

new AdminGate1;
new 
AdminGate2;
new 
AdminGatesMove[MAX_PLAYERS];
//under onplayerupdate
    //AdminGates move
    
if(IsPlayerInRangeOfPoint(playerid7.0, -82.88,-1648.43,3.64))
    {
      if(
PlayerInfo[playerid][pAdmin] > 9)
      {
         
AdminGatesMove[playerid] =3;
      }
    }
//Create a timer for one second.
//post this under it
      
if(AdminGatesMove[i] > 1//move it down (whereever u want)
      
{
         
MoveObject(AdminGate1, -79.4000015,-1647.1999512,-2.59999995.00.0000000,0.0000000,196.0000000);
         
MoveObject(AdminGate2, -87.0000000,-1649.4000244,-2.5999999,5,0.0000000,0.0000000,196.0000000);
         
AdminGatesMove[i]--;
      }
      if(
AdminGatesMove[i] == 1// back to it's original spot
      
{
         
MoveObject(AdminGate1, -79.4000015,-1647.1999512,5.7999999,5,0.0000000,0.0000000,196.0000000);
         
MoveObject(AdminGate2, -87.0000000,-1649.4000244,5.7999999,5,0.0000000,0.0000000,196.0000000);
         
AdminGatesMove[i] =-1;
      } 
that's from my server, hope that helps
of course add the gates under ongamemodeinit AdminGate1 = createobject.........
Reply
#9

Код:
CMD:achat(playerid, params[])
{
	new string[128], text[128], pname[MAX_PLAYER_NAME+1];
	GetPlayerName(playerid, pname, sizeof(pname));

	if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} /a(chat) [text]");

	if(pInfo[playerid][Admin] == 0) return SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You're not an administrator!");

	format(string, sizeof(string), "[LVL: %d]{FFFFFF}  %s: %s", pInfo[playerid][Admin], pname, text);
	SendAdminMessage(0x46E850FF, string);

	return 1;
}
Okay so know i got the adminname in there how do i add it into this command? thanks for the help so far
Reply
#10

Any ideas?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)