PDA

View Full Version : OnPlayerCommandReceived


biker122
21/04/2014, 05:18 AM
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\gamemod es\stunting.pwn(1946) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\samp03z_svr_R1_win32\gamemod es\stunting.pwn(1954) : error 029: invalid expression, assumed zero
C:\Users\Matt\Desktop\samp03z_svr_R1_win32\gamemod es\stunting.pwn(1962) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


Thanks in advance!

Mriss
21/04/2014, 05:35 AM
I need the following lines please:

1946

1954

1962

biker122
21/04/2014, 05:45 AM
Go left on that code.

Stanford
21/04/2014, 06:10 AM
It should be like this:

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!.

biker122
21/04/2014, 01:55 PM
Nope, Still doesn't work. Same errors

biker122
21/04/2014, 02:30 PM
BUMP!

Konstantinos
21/04/2014, 02:35 PM
You have 1 extra closed ")" in those 3 lines.

Bingo
21/04/2014, 02:38 PM
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.