22.06.2010, 20:31
I have made a car spawn script and made this:
pawn Код:
if (strcmp(cmd, "/spawncar", true) ==0 )
{
if (PlayerInfo[playerid][pCar] != 0)
{
if (PlayerInfo[playerid][pCar] == 496)
{
/*new Float: X, Float: Y, Float: Z, Float: Ang, Name[30];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerName(playerid, Name, sizeof( Name ));
PVeh[playerid] = CreateVehicle(522, X, Y , Z, Ang, 75,3, 5000000);
PutPlayerInVehicle(playerid, PVeh[playerid], 0);
LinkVehicleToInterior(PVeh[playerid], GetPlayerInterior(playerid));
printf("personal nrg created for %s.", Name);
SendClientMessage(playerid,0x0066FFAA, "personal nrg created.");
SetVehicleParamsForPlayer(PVeh[playerid], playerid, 0, 0);
for(new i=0; i <= MAX_PLAYERS; i++)
{
if ( IsPlayerConnected(i) )
{
if ( i != playerid )
{
SetVehicleParamsForPlayer(PVeh[playerid], i, 0, 1);
}
}
}*/
SetTimer("Destroyaaa",1,0);
new Float: X, Float: Y, Float: Z, Float: Ang, Name[30];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerName(playerid, Name, sizeof( Name ));
aaa[playerid]=CreateStreamVehicle(496,X ,Y ,Z, Ang,colori,colorii,-1);
PutPlayerInStreamVehicle(playerid,aaa[playerid], 0);
colori = PlayerInfo[playerid][pColi];
colorii = PlayerInfo[playerid][pColii];
new car = GetPlayerStreamVehicleID(playerid);
ChangeStreamVehicleColor(car, colori, colorii);// HIER MOET JE ZIJN !!!
SetStreamVehicleParamsForPlayer(aaa[playerid], playerid, 0, 0);
aaa[playerid] = 1;
for(new i=0; i <= MAX_PLAYERS; i++)
if ( i != playerid )
{
SetStreamVehicleParamsForPlayer(aaa[playerid], i, 0, 1);
}
return 1;..................................
}
It has some more cars in it but thats not important, the important thing is, of i spawn a car it deletes it right away )except for the first car is pawn) now i know this is because of the timer, but that timer has to make sure if i spawn a new car the old one i spawned disapears, but this doesn't happen either + only one player can spawn the car, the deleting the old car deletes every old spawned car (so from other players too), now my question, how could i realise what i need so it deletes the old, and only the old one of me not everybody, when i spawn a new?