problem with playerid
#1

Hey guys, I am very new to scripting (only been scripting for about 1 month) and so I find some things hard...

Basically, I have a thing where someone goes to a pickup and does /buy - when they do this they are frozen, they take a phone, they get a message and after 5 seconds they are thawed, the phone goes away and then a tank is spawned

The person who does /buy is supposed to be effected after 5 seconds, nobody else

Code:
if(PlayerToPoint(1,playerid,2503.1392,-1776.8926,13.5469))
			{
			  if(gTeam[playerid] == 1)
			  {
   				if(greenrhinobought == 0)
					{
						if(GetPlayerMoney(playerid) == 8000 || GetPlayerMoney(playerid) > 8000)
			    	{
    						GivePlayerMoney(playerid,-8000);
            	PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
            	TogglePlayerControllable(playerid,0);
              SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USECELLPHONE);
							SetTimer("greenrhinoorder",5000,false);
							greenrhinobought = 1;
							DestroyPickup(greenrhinomarker);
							SendClientMessage(playerid,COLOR_WHITE,"You have ordered a rhino tank");
						}
						else if (GetPlayerMoney(playerid) < 8000)
						{
	  					SendClientMessage(playerid,COLOR_WHITE,"You do not have enough money to buy this");
			  			PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
						}

					}
					else
					{
					  SendClientMessage(playerid,COLOR_WHITE,"Your team has already purchased this vehicle");
					}

				}
				else
				{
				  SendClientMessage(playerid,COLOR_WHITE,"Only team green members can buy team green vehicles");
				  PlayerPlaySound(playerid, 1053, 0.0, 0.0, 0.0);
				}
				return 1;
			}
That's the first part, the next part is the after the 5 seconds:

Code:
public greenrhinoorder(playerid)
{
	SendClientMessage(playerid,COLOR_GREY,"Team Green Vehicle Factory: your rhino tank has been made and delivered");
	greenrhino = CreateVehicle(432,2502.8743,-1783.7015,13.5608,270.0590,43,0,60);
	SendClientMessageToAll(COLOR_GREEN,"Team green have bought a rhino tank");
	TogglePlayerControllable(playerid,1);
	SetPlayerSpecialAction(playerid,SPECIAL_ACTION_STOPUSECELLPHONE);
	return 1;
}

The problem I face is that instead of the person who used /buy getting effected when the timer ends (getting thawed, a message, phone being put away), but instead player with ID 0 is getting effected...can't figure out why...



Is there something I need to do? Any help would be greatly appreciated!

-Thanks


P.S sorry if this is a dumb question, but I am new to scripting
Reply


Messages In This Thread
problem with playerid - by David_Omid - 13.04.2009, 00:45
Re: problem with playerid - by ICECOLDKILLAK8 - 13.04.2009, 01:00
Re: problem with playerid - by David_Omid - 13.04.2009, 01:04
Re: problem with playerid - by ICECOLDKILLAK8 - 13.04.2009, 01:06
Re: problem with playerid - by David_Omid - 13.04.2009, 01:08

Forum Jump:


Users browsing this thread: 1 Guest(s)