Trouble with Global Values
#1

So, i have this global value outside all functions to make it a global one

Code:
new carguyid;
And some codes to get the carguy's position and set players positions to there when they spawn:

Code:
if (GetPlayerTeam(playerid) == 2)
	{
		new Float:x;
		new Float:y;
		new Float:z;
	    GetPlayerPos(carguyid,x,y,z);
	    SetPlayerPos(playerid,x,y,z + 100);
		SendClientMessage(playerid,COLOR_WHITE,"You are now skidiving over the Carguy, do /Getcar when you want your vehicle!");
	}
Which are fine. I also have a code to set the value of that global var so my server works propperly:

Code:
if (GetPlayerTeam(playerid) == 1)
	{
	    new carguyid = playerid;
               .....................
But pawno gives me these warnings:

Code:
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Carguy.pwn(204) : warning 219: local variable "carguyid" shadows a variable at a preceding level
C:\Users\Henrique\Desktop\SAMP - The Project\Dir\gamemodes\Carguy.pwn(204) : warning 204: symbol is assigned a value that is never used: "carguyid"
Problem: I dont want the carguyid to be a local var when i do "new carguyid = playerid", i want it to set the value of the global var i created back there to the playerid value.

So... little help here?
Reply


Messages In This Thread
Trouble with Global Values - by henry jiggy - 10.09.2011, 13:22
Re: Trouble with Global Values - by Vince - 10.09.2011, 13:37
Re: Trouble with Global Values - by andrew4699 - 10.09.2011, 15:15
Re: Trouble with Global Values - by Kush - 10.09.2011, 15:23
Re: Trouble with Global Values - by henry jiggy - 10.09.2011, 15:29

Forum Jump:


Users browsing this thread: 1 Guest(s)