Darn Error [Help] -
Infinity90 - 23.05.2012
Ok i get these errors
pawn Код:
C:\Documents and Settings\User\Desktop\RP\gamemodes\LS-SW.pwn(3731) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\User\Desktop\RP\gamemodes\LS-SW.pwn(3731) : warning 215: expression has no effect
C:\Documents and Settings\User\Desktop\RP\gamemodes\LS-SW.pwn(3732) : warning 209: function "OnDialogResponse" should return a value
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
Here is the codes
pawn Код:
case D_Toy:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerScore(playerid) < 8)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 356, 1, -0.177908, -0.158685, -0.085900, 0.888899, 13.451434, 0.000000, 1.000000, 1.000000, 1.000000 ); // m4 -
SendClientMessage(playerid, COLOR_YELLOW, "Your M4 has been granted!");
}
case 1:
{
if(GetPlayerScore(playerid) < 12)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 18637, 1, 0.046957, -0.116120, 0.109620, 269.251220, 174.381561, 90.427261, 1.000000, 1.000000, 1.000000 ); // PoliceShield1 - Shield
SendClientMessage(playerid, COLOR_YELLOW, "Your Riot Shield has been granted!");
}
case 2:
{
if(GetPlayerScore(playerid) < 20)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 19078, 1, 0.352603, -0.075285, -0.167187, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // TheParrot1 - Parrot
SendClientMessage(playerid, COLOR_YELLOW, "Your Parrot has been granted!");
}
case 3:
{
if(GetPlayerScore(playerid) < 50)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 2780, 1, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // CJ_SMOKE_MACH - smoke
SendClientMessage(playerid, COLOR_YELLOW, "Your Smoke Machine has been granted!");
}
}
}
+rep for whoever fixes this code!
Re: Darn Error [Help] -
Kathleen_Darling - 23.05.2012
have you got the gamemode files pm me! i had that i fixed it
Re: Darn Error [Help] -
Kitten - 23.05.2012
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
case D_Toy:
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerScore(playerid) < 8)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
{
// m4 -
SetPlayerAttachedObject( playerid, 0, 356, 1, -0.177908, -0.158685, -0.085900, 0.888899, 13.451434, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid, COLOR_YELLOW, "Your M4 has been granted!");
}
}
case 1:
{
if(GetPlayerScore(playerid) < 12)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
{
// PoliceShield1 - Shield
SetPlayerAttachedObject( playerid, 0, 18637, 1, 0.046957, -0.116120, 0.109620, 269.251220, 174.381561, 90.427261, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid, COLOR_YELLOW, "Your Riot Shield has been granted!");
}
}
case 2:
{
if(GetPlayerScore(playerid) < 20)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
{
// TheParrot1 - Parrot
SetPlayerAttachedObject( playerid, 0, 19078, 1, 0.352603, -0.075285, -0.167187, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid, COLOR_YELLOW, "Your Parrot has been granted!");
}
}
case 3:
{
if(GetPlayerScore(playerid) < 50)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
{
// CJ_SMOKE_MACH - smoke
SetPlayerAttachedObject( playerid, 0, 2780, 1, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 );
SendClientMessage(playerid, COLOR_YELLOW, "Your Smoke Machine has been granted!");
}
}
}
}
}
return 1;
}
Re: Darn Error [Help] -
Kathleen_Darling - 23.05.2012
that what i was going to do but i dint know if i was aloud to post like that
Re: Darn Error [Help] -
leonardo1434 - 23.05.2012
pawn Код:
new Menu:CurrentMenu = GetPlayerMenu(playerid); // HERE IS TO CHECK THE PLAYER MENU
if(CurrentMenu == HERE) // PUT THE NAME OF YOUR MENU
{
switch(row)
{
case 0:
{
if(GetPlayerScore(playerid) < 8)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 356, 1, -0.177908, -0.158685, -0.085900, 0.888899, 13.451434, 0.000000, 1.000000, 1.000000, 1.000000 ); // m4 -
SendClientMessage(playerid, COLOR_YELLOW, "Your M4 has been granted!");
}
case 1:
{
if(GetPlayerScore(playerid) < 12)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 18637, 1, 0.046957, -0.116120, 0.109620, 269.251220, 174.381561, 90.427261, 1.000000, 1.000000, 1.000000 ); // PoliceShield1 - Shield
SendClientMessage(playerid, COLOR_YELLOW, "Your Riot Shield has been granted!");
}
case 2:
{
if(GetPlayerScore(playerid) < 20)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 19078, 1, 0.352603, -0.075285, -0.167187, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // TheParrot1 - Parrot
SendClientMessage(playerid, COLOR_YELLOW, "Your Parrot has been granted!");
}
case 3:
{
if(GetPlayerScore(playerid) < 50)
{
SendClientMessage(playerid,C_SKYBLUE,"Not enough score!");
return 1;
}
else
SetPlayerAttachedObject( playerid, 0, 2780, 1, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000 ); // CJ_SMOKE_MACH - smoke
SendClientMessage(playerid, COLOR_YELLOW, "Your Smoke Machine has been granted!");
}
}
}
Re: Darn Error [Help] -
Infinity90 - 23.05.2012
Both dont work, same error