08.08.2012, 09:07
pawn Код:
new cmd[128], idx, str[128];
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/placa", true) == 0)
{
if(IsPlayerConnected(playerid) && !IsPlayerInAnyVehicle(playerid))
{
new tmp[128];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, " [ ! ] Escribe: /placa [Texto]");
new Float:x, Float:y, Float:z, Float:a, vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
GetVehiclePos(vehicleid,x,y,z);
GetVehicleZAngle(vehicleid,a);
SetVehicleNumberPlate(vehicleid,tmp);
SetVehicleToRespawn(vehicleid);
PutPlayerInVehicle(playerid,vehicleid,0);
SetVehiclePos(vehicleid,x,y,z);
SetVehicleZAngle(vehicleid,a);
new Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, sizeof(Name));
format(str, sizeof(str), "%s A Cambiado La Placa De Su Vehнculo a %s", Name,tmp);
SendClientMessageToAll(-1,str);
}
else return SendClientMessage(playerid, -1, " [ ! ] No Estas En Un Vehiculo!.");
return 1;
}