pawn Код:
CMD:car(playerid, params[])
{
if(PlayerInfo[playerid][pRights] < 3) SendClientMessage(playerid, COL_RED, "[SERVER]: You don't have the rights to use this command.");
else if(isnull(params)) SendClientMessage(playerid, COL_RED, "[USAGE]: /car [vehicle name / model].");
else{
new Model = ReturnVehicleID(params);
if(Model == INVALID_VEHICLE_ID)
{
if(strlen(params) > 8) params[8] = EOS;
Model = strval(params);
if(!(400 <= Model <= 611))
return SendClientMessage(playerid, COL_RED, "[SERVER]: Vehicle name/id not found.");
}
new message[75], Float:pPos[4], vid;
GetPlayerPos(playerid, pPos[0], pPos[1], pPos[2]);
GetPlayerFacingAngle(playerid, pPos[3]);
vid = CreateVehicle(Model, pPos[0], pPos[1], pPos[2] + 1, pPos[3], 0, 1, 60);
PutPlayerInVehicle(playerid, vid, 0);
format(message, sizeof(message), "You have spawned a %s.", GetVehicleNames(vid));
SendClientMessage(playerid, COL_GREEN, message);
}
return 1;
}