Scripting error - "Expected token "," but found "}"
#1

I added some code onto an animation script, but I get these errors :

Код:
			else if (listitem == 19) {
                ApplyAnimation(playerid, "MISC", "bitchslap", 4.0,0,0,0,0,0);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Bitch Slap'.");
			}
			else if (listitem == 20) {
                ApplyAnimation(playerid, "ped", "ARRESTgun", 4.0, 0, 1, 1, 1,500);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Gun Arrest'.");
		    }
			else if (listitem == 21) {
                ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Rapping'."
				}
			else if (listitem == 22) {
                ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 1,500);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Threat'."
                }
			else if (listitem == 23) {
                ApplyAnimation(playerid, "PAULNMAC", "wank_loop", 4.0, 1, 0, 0, 1, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Wank'."
                }
			else if (listitem == 24) {
                ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Ass Slap'."
				}
			else if (listitem == 25) {
                ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 0, 0, 1, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dead'."
				}
			else if (listitem == 26) {
                ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Deal'."
                }
			else if (listitem == 27) {
                ApplyAnimation(playerid, "MEDIC","CPR",4.1,0,0,0,0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'CPR'."
                }
			else if (listitem == 28) {
                ApplyAnimation(playerid, "benchpress","gym_bp_celebrate",4.1,0,1,1,1,1);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Bench Press'."
                }
			else if (listitem == 29) {
                ApplyAnimation(playerid, "GHANDS","gsign2LH", 4.1,0,1,1,1,1);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Gang Sign'."
				}
			else if (listitem == 30) {
                ApplyAnimation(playerid, "RIOT","RIOT_CHANT", 4.0, 1, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Chant'."
				}
			else if (listitem == 31) {
                ApplyAnimation(playerid, "KISSING","Grlfrd_Kiss_02", 4.0,0,0,0,0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Kiss'."
                }
            else if (listitem == 32) {
                ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Gun Reload'."
		}
		return 1;
	}
Reply
#2

wich line gives error ?
you have to put ); at the end of SendClientMessage2 Function...
Try this:
pawn Код:
else if (listitem == 19) {
                ApplyAnimation(playerid, "MISC", "bitchslap", 4.0,0,0,0,0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Bitch Slap'.");
            }
            else if (listitem == 20) {
                ApplyAnimation(playerid, "ped", "ARRESTgun", 4.0, 0, 1, 1, 1,500);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Gun Arrest'.");
            }
            else if (listitem == 21) {
                ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 0, 0, 0, 0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Rapping'.");
                }
            else if (listitem == 22) {
                ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 0, 0, 0, 1,500);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Threat'.");
                }
            else if (listitem == 23) {
                ApplyAnimation(playerid, "PAULNMAC", "wank_loop", 4.0, 1, 0, 0, 1, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Wank'.");
                }
            else if (listitem == 24) {
                ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 4.0, 0, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Ass Slap'.");
                }
            else if (listitem == 25) {
                ApplyAnimation(playerid, "WUZI", "CS_Dead_Guy", 4.0, 0, 0, 0, 1, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dead'.");
                }
            else if (listitem == 26) {
                ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 4.0, 0, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Deal'.");
                }
            else if (listitem == 27) {
                ApplyAnimation(playerid, "MEDIC","CPR",4.1,0,0,0,0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'CPR'.");
                }
            else if (listitem == 28) {
                ApplyAnimation(playerid, "benchpress","gym_bp_celebrate",4.1,0,1,1,1,1);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Bench Press'.");
                }
            else if (listitem == 29) {
                ApplyAnimation(playerid, "GHANDS","gsign2LH", 4.1,0,1,1,1,1);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Gang Sign'.");
                }
            else if (listitem == 30) {
                ApplyAnimation(playerid, "RIOT","RIOT_CHANT", 4.0, 1, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Chant'.");
                }
            else if (listitem == 31) {
                ApplyAnimation(playerid, "KISSING","Grlfrd_Kiss_02", 4.0,0,0,0,0,0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Kiss'.");
                }
            else if (listitem == 32) {
                ApplyAnimation(playerid, "SILENCED", "Silence_reload", 3.0, 0, 0, 0, 0, 0);
                SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Gun Reload'.");
        }
        return 1;
    }
if not worked put your code and tell me wich line gives error
good luck
Reply
#3

You're missing the

pawn Код:
);
after every SendClientMessage.
Reply
#4

PHP код:
else if (listitem == 19) {
                
ApplyAnimation(playerid"MISC""bitchslap"4.0,0,0,0,0,0);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Bitch Slap'.");
            };
            else if (
listitem == 20) {
                
ApplyAnimation(playerid"ped""ARRESTgun"4.00111,500);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Gun Arrest'.");
            };
            else if (
listitem == 21) {
                
ApplyAnimation(playerid"RAPPING""Laugh_01"4.00000,0);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Rapping'."
                
};
            else if (
listitem == 22) {
                
ApplyAnimation(playerid"SHOP""ROB_Loop_Threat"4.00001,500);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Threat'."
                
};
            else if (
listitem == 23) {
                
ApplyAnimation(playerid"PAULNMAC""wank_loop"4.010010);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Wank'."
                
};
            else if (
listitem == 24) {
                
ApplyAnimation(playerid"SWEET""sweet_ass_slap"4.000000);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Ass Slap'."
                
};
            else if (
listitem == 25) {
                
ApplyAnimation(playerid"WUZI""CS_Dead_Guy"4.000010);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Dead'."
                
};
            else if (
listitem == 26) {
                
ApplyAnimation(playerid"DEALER""DEALER_DEAL"4.000000);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Deal'."
                
};
            else if (
listitem == 27) {
                
ApplyAnimation(playerid"MEDIC","CPR",4.1,0,0,0,0,0);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'CPR'."
                
};
            else if (
listitem == 28) {
                
ApplyAnimation(playerid"benchpress","gym_bp_celebrate",4.1,0,1,1,1,1);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Bench Press'."
                
};
            else if (
listitem == 29) {
                
ApplyAnimation(playerid"GHANDS","gsign2LH"4.1,0,1,1,1,1);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Gang Sign'."
                
};
            else if (
listitem == 30) {
                
ApplyAnimation(playerid"RIOT","RIOT_CHANT"4.010000);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Chant'."
                
};
            else if (
listitem == 31) {
                
ApplyAnimation(playerid"KISSING","Grlfrd_Kiss_02"4.0,0,0,0,0,0);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Kiss'."
                
};
            else if (
listitem == 32) {
                
ApplyAnimation(playerid"SILENCED""Silence_reload"3.000000);
                
SendClientMessage2(playeridCOLOR_WHITE"ACTION: Applied animation 'Gun Reload'."
        
};
        return 
1;
    } 
Reply
#5

I get this error with my scripting :

Код:
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2335 -- 2336) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2339 -- 2340) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2343 -- 2344) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2347 -- 2348) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2351 -- 2352) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2355 -- 2356) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2359 -- 2360) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2363 -- 2364) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2367 -- 2368) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2371 -- 2372) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2375 -- 2376) : error 001: expected token: ",", but found "}"
C:\Users\Moggs\Downloads\elg\gamemodes\bb_freeroam.pwn(2379 -- 2381) : error 001: expected token: ",", but found "}"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


12 Errors.
If you want the scripting before, here you go:

Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	pdialog[playerid] = -1;

	new string[50], tmp2[256], playername[MAX_PLAYER_NAME], giveplayer[MAX_PLAYER_NAME], tmp[32], temp1, temp2, temp3;
	GetPlayerName(playerid, playername, MAX_PLAYER_NAME);

	if (dialogid == DIALOG_ACTIONS)
	{
		if (response)
		{
			if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED)
				return SendClientMessage2(playerid, COLOR_RED, "Error: You are cuffed!");
			lganim[playerid] = false;
			if (listitem == 0) {
				ApplyAnimation2(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Sitting'.");
			}
			else if (listitem == 1) {
				ApplyAnimation2(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Plant Bomb'.");
			}
			else if (listitem == 2) {
				ApplyAnimation2(playerid, "ped", "endchat_03", 4.0, 0, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Wave'.");
			}
			else if (listitem == 3) {
				ApplyAnimation2(playerid, "MISC", "Scratchballs_01", 4.0, 0, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Scratch Balls'.");
			}
			else if (listitem == 4) {
				ApplyAnimation2(playerid, "COP_AMBIENT", "Coplook_loop", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Cross Arms'.");
			}
			else if (listitem == 5) {
				ApplyAnimation2(playerid, "ped", "cower", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Hide'.");
			}
			else if (listitem == 6) {
				ApplyAnimation2(playerid, "ped", "handsup", 4.0, 0, 0, 0, 1, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Hands Up'.");
			}
			else if (listitem == 7) {
				ApplyAnimation2(playerid, "FOOD", "EAT_Vomit_P", 4.0, 0, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Vomit'.");
			}
			else if (listitem == 8) {
				ApplyAnimation2(playerid, "SMOKING", "M_smklean_loop", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Smoking'.");
			}
			else if (listitem == 9) {
				ApplyAnimation2(playerid, "BEACH", "bather", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Lay'.");
			}
			else if (listitem == 10) {
				ApplyAnimation2(playerid, "ped", "IDLE_chat", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Talking'.");
			}
			else if (listitem == 11) {
				ApplyAnimation2(playerid, "ped", "endchat_02", 4.0, 0, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'No Way'.");
			}
			else if (listitem == 12) {
				ApplyAnimation2(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Crack'.");
			}
			else if (listitem == 13) {
				ApplyAnimation2(playerid, "DANCING", "dnce_M_a", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dance 1'.");
			}
			else if (listitem == 14) {
				ApplyAnimation2(playerid, "DANCING", "dnce_M_b", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dance 2'.");
			}
			else if (listitem == 15) {
				ApplyAnimation2(playerid, "DANCING", "dnce_M_c", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dance 3'.");
			}
			else if (listitem == 16) {
				ApplyAnimation2(playerid, "DANCING", "dnce_M_d", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dance 4'.");
			}
			else if (listitem == 17) {
				ApplyAnimation2(playerid, "DANCING", "dnce_M_e", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Dance 5'.");
			}
			else if (listitem == 18) {
				ApplyAnimation2(playerid, "ped", "SEAT_idle", 4.0, 1, 0, 0, 0, -1);
				SendClientMessage2(playerid, COLOR_WHITE, "ACTION: Applied animation 'Chair Sitting'.");
			}

		}
		return 1;
	}
I've just wanted to add in some animations to the list.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)