Help with admin levels!
#1

I made a command with my tcash script trying to make it with my aLevel (admin level) thing but it's not working. It saves my admin level but when i make new acc and do only admin commands it does it for anybody!

Код:
	if(strcmp("/givemetcash", cmdtext, true) == 0)
	{
	 	if(PlayerInfo[playerid][aLevel] = 0) return SendClientMessage(playerid, red, "You are not an admin");

		GivePlayerTcash(playerid, 1000000);

		SendClientMessage(playerid, green, "You got 1 million Tcash!");
		return 1;
	}

Reply
#2

Copy and paste that into your script, and try now

pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");

        GivePlayerTcash(playerid, 1000000);

        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
you had to put a 1 in,
pawn Код:
[aLevel] = 0
hope this helped!
Reply
#3

Quote:
Originally Posted by [CK
Steel ]
Copy and paste that into your script, and try now

pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");

        GivePlayerTcash(playerid, 1000000);

        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
FAIL +1


pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] == 0/*Note the ==*/) return SendClientMessage(playerid, red, "You are not an admin");
        GivePlayerTcash(playerid, 1000000);
        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
Reply
#4

Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [CK
Steel ]
Copy and paste that into your script, and try now

pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");

        GivePlayerTcash(playerid, 1000000);

        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
FAIL +1


pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] == 0/*Note the ==*/) return SendClientMessage(playerid, red, "You are not an admin");
        GivePlayerTcash(playerid, 1000000);
        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
Dude are you a complete RETARD? Omg, and stop trying to cause flames... He supposed to put 1 cause that is the admin LEVEL. And first of all you do not know how to read damn posts cause he said he wanted it so that it lets ONLY admins type/Do that command. So if he wants admins to do that command then he needs to place a 1 in,
Код:
[aLevel] == 1
. First of all 1 signifies the admin level. 1, 2, 3, 4, 5 or what ever the Admin level is it in his script. If he puts 0 then it will let everyone use it, those who are not admins. Get me now? Duh.

So use this one...

pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] == 1) return SendClientMessage(playerid, red, "You are not an admin"); // [aLevel] == 1 signifies that level admins +1 will be able to use that command.
         GivePlayerTcash(playerid, 1000000);
         SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
Reply
#5

Quote:
Originally Posted by [CK
Steel ]
Quote:
Originally Posted by [HiC
TheKiller ]
Quote:
Originally Posted by [CK
Steel ]
Copy and paste that into your script, and try now

pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] = 1) return SendClientMessage(playerid, red, "You are not an admin");

        GivePlayerTcash(playerid, 1000000);

        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
FAIL +1


pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] == 0/*Note the ==*/) return SendClientMessage(playerid, red, "You are not an admin");
        GivePlayerTcash(playerid, 1000000);
        SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
Dude are you a complete RETARD? Omg, and stop trying to cause flames... He supposed to put 1 cause that is the admin LEVEL. And first of all you do not know how to read damn posts cause he said he wanted it so that it lets ONLY admins type/Do that command. So if he wants admins to do that command then he needs to place a 1 in,
Код:
[aLevel] == 1
. First of all 1 signifies the admin level. 1, 2, 3, 4, 5 or what ever the Admin level is it in his script. If he puts 0 then it will let everyone use it, those who are not admins. Get me now? Duh.

So use this one...

pawn Код:
if(strcmp("/givemetcash", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][aLevel] == 1) return SendClientMessage(playerid, red, "You are not an admin"); // [aLevel] == 1 signifies that level admins +1 will be able to use that command.
         GivePlayerTcash(playerid, 1000000);
         SendClientMessage(playerid, green, "You got 1 million Tcash!");
        return 1;
    }
Wow, you really are a noob!

pawn Код:
if(PlayerInfo[playerid][aLevel] == 1/*Which means that the player is admin? Correct?*/) return SendClientMessage(playerid, red, "You are not an admin"); /*This then returns the player is NOT admin.*/
So which is it? Player is admin or isn't? The one above will return "You are not an admin" if they are equal to the variable one which is probably level 1.
pawn Код:
if(PlayerInfo[playerid][aLevel] == 0/*Which means that the player is not admin? Correct?*/) return SendClientMessage(playerid, red, "You are not an admin"); /*This then returns the player is NOT admin.*/
This one will return the correct thing.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)