21.01.2013, 15:03
pawn Код:
if (strcmp("/v", cmd, true, 10) == 0)
{
new tmp[512];
tmp = strtok(cmdtext, idx);
if(strlen(tmp) == 0)
{
if(GetPlayerInterior(playerid) > 1) return GameTextForPlayer(playerid, "~r~You can't spawn cars in interior!", 5000, 5);
ShowPlayerDialog(playerid, DIALOGID+10, DIALOG_STYLE_LIST, "Vehicles", "{ffff00}Categories\n{ffcc00}Preview mode {00ff00}NEW!", "..::Ok::..", "..::Return::..");
return 1;
}
if(strval(tmp) < 400 || strval(tmp) > 611) return GameTextForPlayer(playerid, "~r~Vehicle id from 400 to 611. Or use just /v!", 5000, 5);
if(IsPlayerInAnyVehicle(playerid)) return GameTextForPlayer(playerid, "~r~Exit the vehicle!", 5000, 5);
new Float:x,Float:y,Float:z,Float:a, veh;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
veh = CreateVehicle(strval(tmp),x+1,y+1,z,a,1,1,10000);
PutPlayerInVehicle(playerid, veh, 0);
if((CallRemoteFunction("IsVehicleOwned", "d", curveh[playerid]) == 0))
{
DestroyVehicle(curveh[playerid]);
}
curveh[playerid] = veh;
return 1;
}