PDA

View Full Version : Only for admin level 9


DexToxz
20/11/2011, 10:28 AM
hey there!
can you please made this Commands only for admins level 9 and 10?
if (strcmp("/opengate", cmdtext, true, 10) == 0)
{
MoveObject(gate,1627.48156738,641.35876465,5.56952 858, 3.0);
GameTextForPlayer(playerid, "~w~Gate opened, Welcome", 5000, 5);
return 1;
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
MoveObject(gate,1627.47692871,641.25878906,13.8192 3294, 3.0);
GameTextForPlayer(playerid, "~w~Gate close, Goodbye", 5000, 5);
return 1;
}

Thanks alot :D

SmiT
20/11/2011, 10:29 AM
:picard: Show us your "admin" variable.

DexToxz
20/11/2011, 10:43 AM
what you mean?

Joshb93
20/11/2011, 10:45 AM
We need to know the "admin" variable

such as "pAdmin"

SmiT
20/11/2011, 10:46 AM
You've just told us to make those 2 commands only for admin level 9 and 10, how could we now what's your admin variable? - an example would be the "pAdmin" from godfather mode.

DexToxz
20/11/2011, 10:48 AM
LuxAdmin

Joshb93
20/11/2011, 10:49 AM
You've just told us to make those 2 commands only for admin level 9 and 10, how could we now what's your admin variable? - an example would be the "pAdmin" from godfather mode.

I beat you to it. :D

---------------------------------------------

An easy way to find out the variable, is to search an admin command, for example, "/slap"
then, you should see something like if(PlayerInfo[playerid][AdminVariableHere] ...

Whatever word is right there, where ive highlighted in red, is your admin variable.

Please find that, and let us know.

Joshb93
20/11/2011, 10:54 AM
if (strcmp("/opengate", cmdtext, true, 10) == 0)
{
if(AccInfo[playerid][Level] == 9 || AccInfo[playerid][Level] == 10)
{
MoveObject(gate,1627.48156738,641.35876465,5.56952 858, 3.0);
GameTextForPlayer(playerid, "~w~Gate opened, Welcome", 5000, 5);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_HERE, "You are not allowed to use this commmand!");
return 1;
}
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
if(AccInfo[playerid][Level] == 9 || AccInfo[playerid][Level] == 10)
{
MoveObject(gate,1627.47692871,641.25878906,13.8192 3294, 3.0);
GameTextForPlayer(playerid, "~w~Gate close, Goodbye", 5000, 5);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_HERE, "You are not allowed to use this commmand!");
return 1;
}
}

where i highlighted COLOR_HERE, you need to change that to a color.. any color that you want

=WoR=G4M3Ov3r
20/11/2011, 10:55 AM
if (strcmp("/opengate", cmdtext, true, 10) == 0)
{
if(AccInfo[playerid][Level] >= 9 )
{
MoveObject(gate,1627.48156738,641.35876465,5.56952 858, 3.0);
GameTextForPlayer(playerid, "~w~Gate opened, Welcome", 5000, 5);
return 1;
}
}

if (strcmp("/closegate", cmdtext, true, 10) == 0)
{
if(AccInfo[playerid][Level] >= 9 )
{
MoveObject(gate,1627.47692871,641.25878906,13.8192 3294, 3.0);
GameTextForPlayer(playerid, "~w~Gate close, Goodbye", 5000, 5);
return 1;
}
}

Joshb93
20/11/2011, 10:57 AM
if (strcmp("/opengate", cmdtext, true, 10) == 0)
{
if(AccInfo[playerid][Level] >= 9 )
{
MoveObject(gate,1627.48156738,641.35876465,5.56952 858, 3.0);
GameTextForPlayer(playerid, "~w~Gate opened, Welcome", 5000, 5);
return 1;
}
if (strcmp("/closegate", cmdtext, true, 10) == 0)
{

if(AccInfo[playerid][Level] >= 9 )
{
MoveObject(gate,1627.47692871,641.25878906,13.8192 3294, 3.0);
GameTextForPlayer(playerid, "~w~Gate close, Goodbye", 5000, 5);
return 1;
}

You have a missing bracket there bud.. :D

Tom_Adams
20/11/2011, 11:06 AM
if(AccInfo[playerid][Level] == 9 || AccInfo[playerid][Level] == 10)
Or use
if(AccInfo[playerid][Level] >= 9 )

=WoR=G4M3Ov3r
20/11/2011, 11:10 AM
You have a missing bracket there bud.. :D

Not quite, compiles fine, and I'm workin atm, so I don't know what I missed or what I didn't, just added if(AccInfo[playerid][Level] >= 9 ) and closed the browser. But I'm sure it'll work.

Joshb93
20/11/2011, 11:14 AM
Not quite, compiles fine, and I'm workin atm, so I don't know what I missed or what I didn't, just added if(AccInfo[playerid][Level] >= 9 ) and closed the browser. But I'm sure it'll work.

Check your post again..

=WoR=G4M3Ov3r
20/11/2011, 11:33 AM
Nvm, Edited, can't believe I missed that...

DexToxz
20/11/2011, 11:40 AM
Errors

Cant find Symbol"AccInfo"

=WoR=G4M3Ov3r
20/11/2011, 11:41 AM
Errors

You said you were using LuxAdmin ...

And make sure you put it under the OnPlayerCommandText callback.