#1

Hello,

i have Vip cmds so i need that only vip can use it !@!
i saved vip by :
Код:
enum pInfo {
    Logged,
    Password,
    AdminLevel,
    Vip,
    Cash,
    Score,
    Ip[20],
    IsBanned
}
Heres cmd :
Код:
if (strcmp("/vheal", cmdtext, true, 5) == 0)
    {
		SetPlayerHealth(playerid, 100);
		SendClientMessage(playerid, white, "You Have Been Healed !");
        return 1;
    }
Hope you Help me !
Thanks
Reply
#2

pawn Код:
if (strcmp("/vheal", cmdtext, true, 5) == 0)
{
    if(pInfo[playerid][VIP]) //change this
    {
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, white, "You Have Been Healed !");
    }
    else
    {
        SendClientMessage(playerid,COLOR_RED,"You are not VIP to use this command");
    }
    return 1;
}
Reply
#3

errors :
Код:
E:\Server\gamemodes\galaxy.pwn(266) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
E:\Server\gamemodes\galaxy.pwn(266) : warning 215: expression has no effect
E:\Server\gamemodes\galaxy.pwn(266) : error 001: expected token: ";", but found "]"
E:\Server\gamemodes\galaxy.pwn(266) : error 029: invalid expression, assumed zero
E:\Server\gamemodes\galaxy.pwn(266) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Did you read what newbienoob said? He said 'if(pInfo[playerid][VIP]) //change this', do you know what change mean? Change the pInfo by your defined symbol, maybe PlayerInfo or something like that. Give us the line under the enum of pInfo and we will be able to help you.
Reply
#5

What he said ^!
Reply
#6

The enum information:

pawn Код:
enum pInfo
{
    Logged,
    Password,
    AdminLevel,
    VIP,
    Cash,
    Score,
    Ip[20],
    IsBanned
};
new PlayerInfo[MAX_PLAYERS][pInfo];
The command:

pawn Код:
COMMAND:vheal(playerid, params[])
{
    if(pInfo[playerid][VIP]) //change this
    {
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, white, "You have been healed!");
    }
    else
    {
        SendClientMessage(playerid,COLOR_RED, "You are not VIP to use this command!");
    }
    return 1;
}
Reply
#7

Still same errors :
Код:
E:\Server\gamemodes\galaxy.pwn(267) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
E:\Server\gamemodes\galaxy.pwn(267) : warning 215: expression has no effect
E:\Server\gamemodes\galaxy.pwn(267) : error 001: expected token: ";", but found "]"
E:\Server\gamemodes\galaxy.pwn(267) : error 029: invalid expression, assumed zero
E:\Server\gamemodes\galaxy.pwn(267) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#8

and also add this at top :
pawn Код:
#include <a_samp>
Reply
#9

Quote:
Originally Posted by Avi57
Посмотреть сообщение
Still same errors :
God, are you retarded? Two people have already said that you need to input your own variable where it says "//change this"!

pawn Код:
if(PlayerInfo[playerid][VIP]) //change this
Reply
#10

Quote:
Originally Posted by Vince
Посмотреть сообщение
God, are you retarded? Two people have already said that you need to input your own variable where it says "//change this"!

pawn Код:
if(PlayerInfo[playerid][VIP]) //change this
See now :
Код:
if (strcmp("/vheal", cmdtext, true, 5) == 0)
    {
        if(pInfo[playerid][Vip]) //change this
        {
        SetPlayerHealth(playerid, 100);
        SendClientMessage(playerid, white, "You Have Been Healed !");
        }
        else
        {
        SendClientMessage(playerid,COLOR_RED,"You are not VIP to use this command");
        }
        return 1;
}
and :

Код:
enum pInfo {
    Logged,
    Password,
    AdminLevel,
    Vip,
    Cash,
    Score,
    Ip[20],
    IsBanned
}
Still errors
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)