OnPlayerCommandReceived
#1

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(PlayerInfo[playerid][InDM] != 0 && PlayerInfo[playerid][pAdminLevel] < 1)
    {
        if(strcmp(cmdtext,"/leave") != 0 && strcmp(cmdtext,"/pm") != 0 && strcmp(cmdtext,"/report") != 0 && strcmp(cmdtext,"/irc") != 0)) //Line 1946
        {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] "GREY"You cannot use these commands while on a DM!");
            return 0;
        }
    }
    if(PlayerInfo[playerid][InNRGParkour] != 0 || PlayerInfo[playerid][InParkour] != 0 || PlayerInfo[playerid][InBMXParkour] != 0 && PlayerInfo[playerid][pAdminLevel] < 1)
    {
        if(strcmp(cmdtext,"/leave") != 0 && strcmp(cmdtext,"/pm") != 0 && strcmp(cmdtext,"/report") != 0 && strcmp(cmdtext,"/irc") != 0)) //Line 1954
        {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] "GREY"You cannot use these commands while on a parkour event!");
            return 0;
        }
    }
    if(PlayerInfo[playerid][Joined] == true && PlayerInfo[playerid][pAdminLevel] < 1)
    {
        if(strcmp(cmdtext,"/leaverace") != 0 && strcmp(cmdtext,"/pm") != 0 && strcmp(cmdtext,"/report") != 0 && strcmp(cmdtext,"/irc") != 0))//Line 1962
        {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] "GREY"You cannot use these commands while on a race!");
            return 0;
        }
    }
    return 1;
}
So, I get these errors:
Код:
C:\Users\Matt\Desktop\samp03z_svr_R1_win32\gamemodes\stunting.pwn(1946) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\samp03z_svr_R1_win32\gamemodes\stunting.pwn(1954) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\samp03z_svr_R1_win32\gamemodes\stunting.pwn(1962) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
Thanks in advance!
Reply
#2

I need the following lines please:

1946

1954

1962
Reply
#3

Go left on that code.
Reply
#4

It should be like this:

pawn Код:
if(strcmp(cmdtext,"/leaverace", true) == 0 || strcmp(cmdtext,"/pm", true) == 0 || strcmp(cmdtext,"/report", true) == 0 || strcmp(cmdtext,"/irc", true) == 0))//Line 1962
I hope that I helped!.
Reply
#5

Nope, Still doesn't work. Same errors
Reply
#6

BUMP!
Reply
#7

You have 1 extra closed ")" in those 3 lines.
Reply
#8

pawn Код:
public OnPlayerCommandReceived(playerid, cmdtext[])
{
    if(PlayerInfo[playerid][InDM] != 0 && PlayerInfo[playerid][pAdminLevel] < 1)
    {
        if(strcmp(cmdtext,"/leave") != 0 && strcmp(cmdtext,"/pm") != 0 && strcmp(cmdtext,"/report") != 0 && strcmp(cmdtext,"/irc") != 0) //Line 1946
        {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] "GREY"You cannot use these commands while on a DM!");
            return 0;
        }
    }
    if(PlayerInfo[playerid][InNRGParkour] != 0 || PlayerInfo[playerid][InParkour] != 0 || PlayerInfo[playerid][InBMXParkour] != 0 && PlayerInfo[playerid][pAdminLevel] < 1)
    {
        if(strcmp(cmdtext,"/leave") != 0 && strcmp(cmdtext,"/pm") != 0 && strcmp(cmdtext,"/report") != 0 && strcmp(cmdtext,"/irc") != 0) //Line 1954
        {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] "GREY"You cannot use these commands while on a parkour event!");
            return 0;
        }
    }
    if(PlayerInfo[playerid][Joined] == true && PlayerInfo[playerid][pAdminLevel] < 1)
    {
        if(strcmp(cmdtext,"/leaverace") != 0 && strcmp(cmdtext,"/pm") != 0 && strcmp(cmdtext,"/report") != 0 && strcmp(cmdtext,"/irc") != 0)//Line 1962
        {
            SendClientMessage(playerid,COLOR_RED,"[ERROR] "GREY"You cannot use these commands while on a race!");
            return 0;
        }
    }
    return 1;
}
Try now, Should work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)