14.02.2012, 20:27
I don't know exactly whether this command will work well or not, yet check it.
pawn Код:
new VehicleSpawned[MAX_PLAYERS], IsSpawningFirstTime[MAX_PLAYERS];
pawn Код:
public OnPlayerConnect(playerid) {
IsSpawningFirstTime[playerid] = 0;
return 1;
}
pawn Код:
CMD:v(playerid, params[]) {
new P[3];
GetPlayerPos(playerid, P[0], P[1], P[2]); // Use this positions to create the vehicle at your position.
if(!IsSpawningFirstTime[playerid]) {
VehicleSpawned[playerid] = CreateVehicle(...); // Continue this one as in your current command.
PutPlayerInVehicle(playerid, VehicleSpawned[playerid], 0); // Places the playerid in the vehicle he created.
IsSpawningFirstTime[playerid] = 1;
return 1;
}
DestroyVehicle(VehicleSpawned[playerid]);
VehicleSpawned[playerid] = CreateVehicle(...); // Continue this one as in your current command.
PutPlayerInVehicle(playerid, VehicleSpawned[playerid], 0); // Places the playerid in the vehicle he created.
return 1;
}