27.12.2012, 22:24
Hello SA-MP community.
I was thinking about something unique to do in a server: Vehicle exchange.
Now, I have tried some ways to do it, but definetly couldn't make it.
First I have made an IsPlayerInRangeOfPoint thing to check if the player is at the Exchange.
Next, I have checked if the vehicle is a private vehicle. ( playerinfo[playerid][pvehicle] == 1 )
Now my question is.. After I made so you can type /SellVehicle only if you're in a checkpoint and only if its your car ... I want to make it so the vehicle is put on a special slot and has a text label with "%s's vehicle".. How do I do this?
I've heard AddStaticVehicle might be useful? I heard that it only saves a position of a car to be spawned...
I really need help on this. Here is a "try" of scripting this, but I can't complete further.
I know it's kinda stupid and complicated but I would like to have this...
Please help! Thank you very much!
I was thinking about something unique to do in a server: Vehicle exchange.
Now, I have tried some ways to do it, but definetly couldn't make it.
First I have made an IsPlayerInRangeOfPoint thing to check if the player is at the Exchange.
Next, I have checked if the vehicle is a private vehicle. ( playerinfo[playerid][pvehicle] == 1 )
Now my question is.. After I made so you can type /SellVehicle only if you're in a checkpoint and only if its your car ... I want to make it so the vehicle is put on a special slot and has a text label with "%s's vehicle".. How do I do this?
I've heard AddStaticVehicle might be useful? I heard that it only saves a position of a car to be spawned...
I really need help on this. Here is a "try" of scripting this, but I can't complete further.
pawn Код:
CMD:sellvehicle(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 30.0, 1, 1, 1))
{
if(PlayerInfo[playerid][pVehicle] == willeditthis)//ignore willeditthis
{
SetPlayerCheckpoint(playerid, 2, 2, 2);
if(IsPlayerInCheckpoint(playerid))
{
//if these three are applied then put the vehicle in an avaible parking slot and add a text label "%'s vehicle"
}else{
SendClientMessage(playerid, 0xFFFFFFFF, "you're not in any checkpoint");
}
}else{
SendClientMessage(playerid, 0xFFFFFFFF, "you dont have a vehicle);
}
}else{
SendClientMessage(playerid, 0xFFFFFFFF, "you aren't at the Veh. Exchange");
}
return 1;
}
Please help! Thank you very much!