13.03.2015, 22:39
Problem when Some budy spawn his car , other player vehicle got removed.
here is code
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"); }