Need Small help Rep +
#1

Problem when Some budy spawn his car , other player vehicle got removed.

here is code
Код:
			if(pInfo[playerid][pVeh][0] ==1)
			{
            if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"You're in a vehicle.");
			else
			{
	  		if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
   			new Float:pX,Float:pY,Float:pZ,Float:pw;
      		GetPlayerPos(playerid, pX,pY,pZ);
      		GetPlayerFacingAngle(playerid, pw);
   			SpawnedVehicles[playerid] = CreateVehicle(602, pX, pY, pZ, pw, 0, 0, 0);
            PutPlayerInVehicle(playerid, SpawnedVehicles[playerid], 0);
            GameTextForPlayer(playerid,"~w~Alpha",3000,1);
            format(Jstring,sizeof(Jstring),"%s Spawned his Alpha.", GetName(playerid));
			SCMToAll(yellow, Jstring);
			}
			}else return SendClientMessage(playerid,0x00FF00AA,"You didnt have Alpha.");
			}
			    case 1:
			{
			if(pInfo[playerid][pVeh][1] ==1)
			{
   			if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"You're in a vehicle.");
			else
			{
			if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
			new Float:pX,Float:pY,Float:pZ,Float:pw;
   			GetPlayerPos(playerid, pX,pY,pZ);
   			GetPlayerFacingAngle(playerid, pw);
   			SpawnedVehicles[playerid] = CreateVehicle(429, pX, pY, pZ, pw, 0, 0, 0);
            PutPlayerInVehicle(playerid, SpawnedVehicles[playerid], 0);
            GameTextForPlayer(playerid,"~w~Banshee",3000,1);
            format(Jstring,sizeof(Jstring),"%s Spawned his Banshee.", GetName(playerid));
			SCMToAll(yellow, Jstring);
			}
			}else return SendClientMessage(playerid,0x00FF00AA,"You didnt have Banshee");
			}
			    case 2:
			{
			if(pInfo[playerid][pVeh][2] ==1)
			{
   			if(IsPlayerInAnyVehicle(playerid)) SendClientMessage(playerid,0x00FF00AA,"You're in a vehicle.");
			else
			{
			if(SpawnedVehicles[playerid] != 0) DestroyVehicle(SpawnedVehicles[playerid]);
			new Float:pX,Float:pY,Float:pZ,Float:pw;
			GetPlayerPos(playerid, pX,pY,pZ);
   			GetPlayerFacingAngle(playerid, pw);
		 	SpawnedVehicles[playerid] = CreateVehicle(541, pX, pY, pZ, pw, 0, 0, 0);
            PutPlayerInVehicle(playerid, SpawnedVehicles[playerid], 0);
            GameTextForPlayer(playerid,"~w~Bullet",3000,1);
			format(Jstring,sizeof(Jstring),"%s Spawned his Bullet.", GetName(playerid));
			SCMToAll(yellow, Jstring);
			}
			}else return SendClientMessage(playerid,0x00FF00AA,"You didnt have Bullet");
			}
Reply
#2

I've had this issue many times too, haven't found a solution for it yet, try debugging it by printing the player's name and current vehicle ID to the console, somewhere it messes up and assigns it to another player or something, try finding out what it does.
Reply
#3

I dont why it assign playerid or some else ...
so the player other spawn vehicle .. his vehicle got destroyed..

How i can stop Players ID for mixing up ?

its making alot Problem!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)