28.02.2014, 16:03
I don't understand the errors in my script I tried so hardly to correct them but I'm not very good in scripting so can someone give me a corrected version of my script please ?
Here's my script :
#include <a_samp>
#include <zcmd>
public OnPlayerCommandText(playerid, cmdtext[])
// if using ZCMD
CMD:commands(playerid, params[])
{
// using 1 for dialogid might cause conflict, change it to the next available id.
ShowPlayerDialog(playerid, /* dialogid */ 2, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
return 1;
}
// In OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2 /* or the dialogid you selected */)
{
if(response) {
switch(listitem) {
case 0: {
SendClientMessage(playerid, -2, "*Commands* \joindevent\n joingevent\n joinsrevent\n joinmlevent\n joinshevent\n joinsgevent\n joindmevent\n joinpdevent\n joinuzievent\n joinkevent\n joincsevent", "Cancel");
}
case 1: {
if(IsPlayerAdmin(playerid)) {
SendClientMessage(playerid, -2, "*Admin Commands* \devent\n gevent\n srevent\n mlevent\n shevent\n sgevent\n dmevent\n pdeven\n uzievent\n kevent\n csevent\n startminievent\n eh", "Cancel");
}
}
}
}
}
return 0;
}
And here are the compiling errors :
C:\Users\Propriйtaire\Desktop\caca.pwn(7) : error 029: invalid expression, assumed zero
C:\Users\Propriйtaire\Desktop\caca.pwn(22) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(22) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(26) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(26) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(32) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Here's my script :
#include <a_samp>
#include <zcmd>
public OnPlayerCommandText(playerid, cmdtext[])
// if using ZCMD
CMD:commands(playerid, params[])
{
// using 1 for dialogid might cause conflict, change it to the next available id.
ShowPlayerDialog(playerid, /* dialogid */ 2, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
return 1;
}
// In OnDialogResponse
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2 /* or the dialogid you selected */)
{
if(response) {
switch(listitem) {
case 0: {
SendClientMessage(playerid, -2, "*Commands* \joindevent\n joingevent\n joinsrevent\n joinmlevent\n joinshevent\n joinsgevent\n joindmevent\n joinpdevent\n joinuzievent\n joinkevent\n joincsevent", "Cancel");
}
case 1: {
if(IsPlayerAdmin(playerid)) {
SendClientMessage(playerid, -2, "*Admin Commands* \devent\n gevent\n srevent\n mlevent\n shevent\n sgevent\n dmevent\n pdeven\n uzievent\n kevent\n csevent\n startminievent\n eh", "Cancel");
}
}
}
}
}
return 0;
}
And here are the compiling errors :
C:\Users\Propriйtaire\Desktop\caca.pwn(7) : error 029: invalid expression, assumed zero
C:\Users\Propriйtaire\Desktop\caca.pwn(22) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(22) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(26) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(26) : error 027: invalid character constant
C:\Users\Propriйtaire\Desktop\caca.pwn(32) : warning 217: loose indentation
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.