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; }
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.
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;
}
pawn Код:
|
Try this
if(IsPlayerAdmin(playerid)) { } else { ShowPlayerDialog(playerid, etc); } |
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;
}
pawn Код:
|
return 0;
}
it compiles for me correctly
be sure that you have this only 1 at the end of OnPlayerCommandText pawn Код:
|