SA-MP Forums Archive
Playerid - 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: Playerid (/showthread.php?tid=106756)



Playerid - Ironboy500 - 05.11.2009

Hello! I need a little help with my gamemode. I have following under OnPlayerEnterCheckpoint:

Код:
public OnPlayerEnterCheckpoint(playerid)
{
	new string[256]; new playername [MAX_PLAYER_NAME];
	GetPlayerName (playerid, playername, sizeof(string));
  	if(gTeam[playerid] == TEAM_GREEN) {
		format (string, sizeof(string), "Server: %s (%d) is now planting bomb by the big transmitor!", playername, playerid);
		SendClientMessageToAll (ORANGE, string);
		SetTimer ("Disable", 10000, false);
	} else if(gTeam[playerid] == TEAM_BLUE) {
 		SendClientMessage (playerid, RED, "Error: Protect your transmitor!");
	}
	return;
}
And Following Timer to disable checkpoint:

Код:
forward Disable();
public Disable()
{
  DisablePlayerCheckpoint (playerid);
}
I get this error:

Quote:

I:\[0.2] Mini Missions Reborn\World war 3\gamemodes\TransmitorVillage.pwn(199) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


2 Errors.

How can I define this "playerid" or help me to do this, fix it

Thanks!




Re: Playerid - Correlli - 05.11.2009

Change:
Quote:
Originally Posted by Ironboy500
Код:
SetTimer ("Disable", 10000, false);
to:
pawn Код:
SetTimerEx("Disable", 10000, false, "i", playerid);
and:
Quote:
Originally Posted by Ironboy500
Код:
forward Disable();
public Disable()
{
  DisablePlayerCheckpoint (playerid);
}
to:
Код:
forward Disable(playerid);

public Disable(playerid)
{
  DisablePlayerCheckpoint(playerid);
}



Re: Playerid - Ironboy500 - 05.11.2009

Thank you very much!


Re: Playerid - -xy! - 05.11.2009

pawn Код:
forward Disable(playerid);
public Disable(playerid)
{
  DisablePlayerCheckpoint(playerid);
}