error 029: invalid expression (help plz) - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: error 029: invalid expression (help plz) (
/showthread.php?tid=368143)
error 029: invalid expression (help plz) -
andrewgrob - 12.08.2012
this wont work. what is wrong
pawn Код:
C:\Documents and Settings\Andrew\Desktop\me\gamemodes\wofr.pwn(8587) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Andrew\Desktop\me\gamemodes\wofr.pwn(8587 -- 8588) : warning 215: expression has no effect
C:\Documents and Settings\Andrew\Desktop\me\gamemodes\wofr.pwn(8588) : error 001: expected token: ";", but found "case"
C:\Documents and Settings\Andrew\Desktop\me\gamemodes\wofr.pwn(8588) : error 014: invalid statement; not in switch
C:\Documents and Settings\Andrew\Desktop\me\gamemodes\wofr.pwn(8588) : fatal error 107: too many error messages on one line
pawn Код:
if ( response )
{
switch ( listitem )
{
case 0:
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}(/glass) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Glass DeathMatch",pName);
SendClientMessageToAll(playerid, string);
new Random = random(sizeof(RandomSpawnGlassDM));
SetPlayerPos(playerid, RandomSpawnGlassDM[Random][0], RandomSpawnGlassDM[Random][1], RandomSpawnGlassDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnGlassDM[Random][3]);
)
case 1:
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}(/minigun) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Minigun DeathMatch",pName);
SendClientMessageToAll(playerid, string);
new Random = random(sizeof(RandomSpawnMinigunDM));
SetPlayerPos(playerid, RandomSpawnMinigunDM[Random][0], RandomSpawnMinigunDM[Random][1], RandomSpawnMinigunDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnMinigunDM[Random][3]);
}
}
}
}
Re: error 029: invalid expression (help plz) -
Jessyy - 12.08.2012
Done!!!
Код:
if ( response )
{
switch ( listitem )
{
case 0:
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}(/glass) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Glass DeathMatch",pName);
SendClientMessageToAll(playerid, string);
new Random = random(sizeof(RandomSpawnGlassDM));
SetPlayerPos(playerid, RandomSpawnGlassDM[Random][0], RandomSpawnGlassDM[Random][1], RandomSpawnGlassDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnGlassDM[Random][3]);
}
case 1:
{
new string[128], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
format(string, sizeof(string), "{FF0000}(/minigun) {FFFF00}Player {FF0000}%s {FFFF00}has Teleported to {FF0000}Minigun DeathMatch",pName);
SendClientMessageToAll(playerid, string);
new Random = random(sizeof(RandomSpawnMinigunDM));
SetPlayerPos(playerid, RandomSpawnMinigunDM[Random][0], RandomSpawnMinigunDM[Random][1], RandomSpawnMinigunDM[Random][2]);
SetPlayerFacingAngle(playerid, RandomSpawnMinigunDM[Random][3]);
}
}
}
Re: error 029: invalid expression (help plz) -
andrewgrob - 12.08.2012
no . it does not work