I need help
#1

I am Trying to make a COmmand for admins to get any weapon they want
This is The Text under OnPlayerCommandText
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/Weapons", cmdtext, true) == 0)
	{
		if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Only Admins Can use This Command!");
		else
		{
	    ShowPlayerDialog(playerid, DIALOG_WEAPONS, 2, "Weapons", "Melee Weapons\nPistols\nSub Machine Guns\nShotguns\nRifles\nAssault Rifles\nThrowables\nHeavy Weaponry", "Select", "Cancel");
		}
		return 1;
	}
	return 0;
}
Line 115 is The Line with ShowPlayerDialog
These are the errors I get
Код:
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : error 001: expected token: ",", but found ";"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : error 029: invalid expression, assumed zero
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : warning 215: expression has no effect
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : error 001: expected token: ";", but found ")"
D:\Program Files (x86)\Rockstar Games\GTA San Andreas\Server\gamemodes\Zmode.pwn(115) : fatal error 107: too many error messages on one line

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


4 Errors.
Plz Help me
I am very new to pawno, so if the mistake is obvious I'm sorry
Reply
#2

Try this
if(IsPlayerAdmin(playerid))
{

}
else
{
ShowPlayerDialog(playerid, etc);
}
Reply
#3

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Weapons", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Only Admins Can use This Command!");
        ShowPlayerDialog(playerid, DIALOG_WEAPONS, 2, "Weapons", "Melee Weapons\nPistols\nSub Machine Guns\nShotguns\nRifles\nAssault Rifles\nThrowables\nHeavy Weaponry", "Select", "Cancel");
        return 1;
    }
    return 0;
}
Reply
#4

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Weapons", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Only Admins Can use This Command!");
        ShowPlayerDialog(playerid, DIALOG_WEAPONS, 2, "Weapons", "Melee Weapons\nPistols\nSub Machine Guns\nShotguns\nRifles\nAssault Rifles\nThrowables\nHeavy Weaponry", "Select", "Cancel");
        return 1;
    }
    return 0;
}
I Still have the Same Errors
Reply
#5

Quote:
Originally Posted by GGRoleplay
Посмотреть сообщение
Try this
if(IsPlayerAdmin(playerid))
{

}
else
{
ShowPlayerDialog(playerid, etc);
}
Didn't Fix it
Reply
#6

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Weapons", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Only Admins Can use This Command!");
        ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Melee Weapons\nPistols\nSub Machine Guns\nShotguns\nRifles\nAssault Rifles\nThrowables\nHeavy Weaponry", "Select", "Cancel");
        return 1;
    }
    return 0;
}
try it
Reply
#7

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/Weapons", cmdtext, true) == 0)
    {
        if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"Only Admins Can use This Command!");
        ShowPlayerDialog(playerid, DIALOG_WEAPONS, DIALOG_STYLE_LIST, "Weapons", "Melee Weapons\nPistols\nSub Machine Guns\nShotguns\nRifles\nAssault Rifles\nThrowables\nHeavy Weaponry", "Select", "Cancel");
        return 1;
    }
    return 0;
}
try it
I Got the Exact Same Errors when I Tried that
Reply
#8

it compiles for me correctly

be sure that you have this only 1 at the end of OnPlayerCommandText
pawn Код:
return 0;
}
Reply
#9

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
it compiles for me correctly

be sure that you have this only 1 at the end of OnPlayerCommandText
pawn Код:
return 0;
}
I have it Just Like you have and It Gives me Those Errors
Reply
#10

send me the whole

public OnPlayerCommandText(playerid, cmdtext[])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)