public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/acp", cmdtext, true, 10) == 0) { IsPlayerAdmin(playerid); { ShowMenuForPlayer(AdminMenu,playerid); return 1; } } else SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command"); return 0; }
else SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command");
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/acp", cmdtext, true,4) == 0) // '/acp' has 4 characters not 10 { if(IsPlayerAdmin(playerid)); //you fogot an 'if' { ShowMenuForPlayer(AdminMenu,playerid); return 1; } else SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command"); } //not here lol return 0; }
Originally Posted by GTAguillaume
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/acp", cmdtext, true,4) == 0) // '/acp' has 4 characters not 10 { if(IsPlayerAdmin(playerid)); //you fogot an 'if' { ShowMenuForPlayer(AdminMenu,playerid); return 1; } else SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command"); } //not here lol return 0; } |
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/acp", cmdtext, true, 4) == 0) // Don't use 10 when the command text is 4 in total with "/".
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command");
else
ShowMenuForPlayer(AdminMenu,playerid);
return 1;
}
/*=======================================================================================================================================*/
}
return 0;
}
C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(47) : error 036: empty statement C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(52) : warning 225: unreachable code C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(52) : error 029: invalid expression, assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/acp", cmdtext, true, 4) == 0) // Don't use 10 when the command text is 4 in total with "/". { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command"); else ShowMenuForPlayer(AdminMenu,playerid); return 1; } /*=======================================================================================================================================*/ } return 0; }
Originally Posted by security
both give error ? first post:
Код:
C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(47) : error 036: empty statement C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(52) : warning 225: unreachable code C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(52) : error 029: invalid expression, assumed zero Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors. other: Код:
C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(53) : warning 209: function "OnPlayerCommandText" should return a value C:\Documents and Settings\Doodaapje\Bureaublad\FS & GM\ADMIN\admin.pwn(54) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Error. |
Originally Posted by GTAguillaume
Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/acp", cmdtext, true,4) == 0) // '/acp' has 4 characters not 10 { if(IsPlayerAdmin(playerid)); //you fogot an 'if' { ShowMenuForPlayer(AdminMenu,playerid); return 1; } else SendClientMessage(playerid, 0xFFFFFFFF, "You need to be admin for this command"); } //not here lol return 0; } |
if(something == something etc etc){ script } else { script }
else if (something == somethingelse etc etc)
Originally Posted by adsy
Quote:
Код:
if(something == something etc etc){ script } else { script } Код:
else if (something == somethingelse etc etc) |