SA-MP Forums Archive
solved XD - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: solved XD (/showthread.php?tid=115073)



solved XD - iJumbo - 22.12.2009

how i fix it??
Код:
public OnPlayerEnterCheckpoint(playerid)
{
switch(GetPlayerCheckpoint(playerid))
{
case 0: {
SetPlayerPos(playerid,281.1523,2527.4270,16.8029);
SetPlayerHealth(playerid, 100);
SetPlayerArmour(playerid, 100);
GivePlayerWeapon(playerid, 38, 100);
GivePlayerWeapon(playerid, 41, 9999);
GivePlayerWeapon(playerid, 32, 9999);
PlayerPlaySound(playerid, 1132,0.0,0.0,0.0);
new name[MAX_PLAYER_NAME+1];	new String[256];	GetPlayerName(playerid, name, sizeof(name));
format(String, sizeof(String), "%s и RIUSCITO A PRENDERE IL PUNTO ROSSO RICEVENDO OGGETTI SPECIALI !!!!", name);	SendClientMessageToAll(COLOR_RED, String);
SendClientMessage(playerid,COLOR_RED, "PUOI TRANQUILLAMENTE TELEPORTARTI IN UN ALTRO POSTO A DIVERTIRTI CON LE TUE NUOVE ARMI (/teles)");
}
case 1: {
new name[MAX_PLAYER_NAME+1];	new String[256];	GetPlayerName(playerid, name, sizeof(name));
format(String, sizeof(String), "%s ha preso i minigun nell' hangar (admin se lo vedete non и cheater :P)", name);	SendClientMessageToAll(COLOR_RED, String);
GivePlayerWeapon(playerid,38,200);
SetPlayerPos(playerid,281.1523,2527.4270,16.8029);
}
case 2: {
if (IsPlayerInAnyVehicle(playerid)) {
//
new name[128];
new string[256];
GetPlayerName(playerid,name,128);
format(string, sizeof(string), "%s ha usato la porta magica a /stunt per provare lo stunt al mare (sono in makkina )",name);
SendClientMessageToAll(0xFF66FFAA, string);
SetVehiclePos(GetPlayerVehicleID(playerid),886.4269,-2905.6716,18.3067);
return 1;
}
error
Код:
only a single statement (or expression) can follow each "case"



Re: HELP ME PLZ how to fix it? - [HiC]TheKiller - 22.12.2009

What line has the error and what is the full error?


Re: HELP ME PLZ how to fix it? - iJumbo - 22.12.2009

Код:
C:\Documents and Settings\SPO\Desktop\ZDMgmnumero1.pwn(4276) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\SPO\Desktop\ZDMgmnumero1.pwn(4276) : warning 215: expression has no effect
C:\Documents and Settings\SPO\Desktop\ZDMgmnumero1.pwn(4277) : warning 209: function "OnPlayerEnterCheckpoint" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
this is full error


Re: HELP ME PLZ how to fix it? - [HiC]TheKiller - 22.12.2009

Quote:
Originally Posted by gigi1223
Код:
C:\Documents and Settings\SPO\Desktop\ZDMgmnumero1.pwn(4276) : error 002: only a single statement (or expression) can follow each "case"
C:\Documents and Settings\SPO\Desktop\ZDMgmnumero1.pwn(4276) : warning 215: expression has no effect
C:\Documents and Settings\SPO\Desktop\ZDMgmnumero1.pwn(4277) : warning 209: function "OnPlayerEnterCheckpoint" should return a value
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
this is full error
What lines are 4276 and 4277?


Re: HELP ME PLZ how to fix it? - iJumbo - 22.12.2009

line 4276, 4277 is the returns


Re: HELP ME PLZ how to fix it? - iJumbo - 22.12.2009

i try this
Код:
public OnPlayerEnterCheckpoint(playerid)
{
switch(GetPlayerCheckpoint(playerid))
{
		case 0:
		{
			SetPlayerPos(playerid,281.1523,2527.4270,16.8029);
			SetPlayerHealth(playerid, 100);
			SetPlayerArmour(playerid, 100);
			GivePlayerWeapon(playerid, 38, 100);
			GivePlayerWeapon(playerid, 41, 9999);
			GivePlayerWeapon(playerid, 32, 9999);
			PlayerPlaySound(playerid, 1132,0.0,0.0,0.0);
			new name[MAX_PLAYER_NAME+1];	new String[256];	GetPlayerName(playerid, name, sizeof(name));
			format(String, sizeof(String), "%s и RIUSCITO A PRENDERE IL PUNTO ROSSO RICEVENDO OGGETTI SPECIALI !!!!", name);	SendClientMessageToAll(COLOR_RED, String);
			SendClientMessage(playerid,COLOR_RED, "PUOI TRANQUILLAMENTE TELEPORTARTI IN UN ALTRO POSTO A DIVERTIRTI CON LE TUE NUOVE ARMI (/teles)");
		}
		case 1:
		{
			new name[MAX_PLAYER_NAME+1];	new String[256];	GetPlayerName(playerid, name, sizeof(name));
			format(String, sizeof(String), "%s ha preso i minigun nell' hangar (admin se lo vedete non и cheater :P)", name);	SendClientMessageToAll(COLOR_RED, String);
			GivePlayerWeapon(playerid,38,200);
			SetPlayerPos(playerid,281.1523,2527.4270,16.8029);
		}
		case 2:
		{
			if (IsPlayerInAnyVehicle(playerid)) {
			//
			new name[128];
			new string[256];
			GetPlayerName(playerid,name,128);
			format(string, sizeof(string), "%s ha usato la porta magica a /stunt per provare lo stunt al mare (sono in makkina )",name);
			SendClientMessageToAll(0xFF66FFAA, string);
			SetVehiclePos(GetPlayerVehicleID(playerid),886.4269,-2905.6716,18.3067);
			return 1;
		}
	}
	return 1;
}



Re: HELP ME PLZ how to fix it? - iJumbo - 22.12.2009

but same error


Re: HELP ME PLZ how to fix it? - [HiC]TheKiller - 22.12.2009

Quote:
Originally Posted by gigi1223
but same error
There is a edit button .

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
switch(GetPlayerCheckpoint(playerid))
{
  case 0:
  {
    SetPlayerPos(playerid,281.1523,2527.4270,16.8029);
    SetPlayerHealth(playerid, 100);
    SetPlayerArmour(playerid, 100);
    GivePlayerWeapon(playerid, 38, 100);
    GivePlayerWeapon(playerid, 41, 9999);
    GivePlayerWeapon(playerid, 32, 9999);
    PlayerPlaySound(playerid, 1132,0.0,0.0,0.0);
    new name[MAX_PLAYER_NAME+1];
    new String[256];   
    GetPlayerName(playerid, name, sizeof(name));
            format(String, sizeof(String), "%s и RIUSCITO A PRENDERE IL PUNTO ROSSO RICEVENDO OGGETTI SPECIALI !!!!", name);    SendClientMessageToAll(COLOR_RED, String);
            SendClientMessage(playerid,COLOR_RED, "PUOI TRANQUILLAMENTE TELEPORTARTI IN UN ALTRO POSTO A DIVERTIRTI CON LE TUE NUOVE ARMI (/teles)");
    }
    case 1:
    {
      new name[MAX_PLAYER_NAME+1];
      new String[256]
      GetPlayerName(playerid, name, sizeof(name));
      format(String, sizeof(String), "%s ha preso i minigun nell' hangar (admin se lo vedete non и cheater :P)", name);  SendClientMessageToAll(COLOR_RED, String);
      GivePlayerWeapon(playerid,38,200);
      SetPlayerPos(playerid,281.1523,2527.4270,16.8029);
    }
    case 2:
    {  
       if (IsPlayerInAnyVehicle(playerid))
       {
         new name[128];
         new string[256];
         GetPlayerName(playerid,name,128);
         format(string, sizeof(string), "%s ha usato la porta magica a /stunt per provare lo stunt al mare (sono in makkina )",name);
         SendClientMessageToAll(0xFF66FFAA, string);
         SetVehiclePos(GetPlayerVehicleID(playerid),886.4269,-2905.6716,18.3067);
       }
    }
  }
  return 1;
}



Re: HELP ME PLZ how to fix it? - iJumbo - 22.12.2009

ty now work im noob XD