17.12.2010, 23:31
i need a way for you to type a cmd like /carchange infernus and the car transforms with you in it ive seen it done before.im not askn for the code just how to start it off
if(strcmp(cmd, "/rp", true) == 0)
{
//if(IsPlayerConnected(playerid)) < ---- this check isn't needed: we know the player is connected
// because he has just typed the command
//{
new Float:x, Float:y, Float:z, Float:Angle;
GetPlayerPos(playerid,x,y,z); // ideally you would use GetVehiclePos when a player is in a vehicle, but it's ok
GetPlayerFacingAngle(playerid,Angle); // same for this, GetVehicleZPos to find a vehicle rotation angle
if (PlayerInfo[playerid][pAdmin] >= 5)
{
//new car;
//car = strval(tmp); <--- I'm not sure where tmp comes from
//if(car == infernus)
//{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
currentveh = CreateVehicle(411,x,y,z,Angle,0,0,3000); // create the new vehicle into the currentveh variable
PutPlayerInVehicle(playerid,currentveh,0); // put player into the new currentveh
SetVehicleZAngle(currentveh, Angle); // set the vehicle rotation
//}
}
//}
}