05.12.2011, 22:29
Bueno gente, Estoy modificando cosas de ladmin, Pero no puedo con este Comando:
Lo Que Quiero en Este Comando Es que el Player cuando Ponga /Vehiculo [Nombre/ID], El Player Spawnee directamente Dentro del Vehiculo... Espero que me Puedan Ayudar, Gracias
pawn Код:
dcmd_vehiculo(playerid,params[]) {
if(PlayerInfo[playerid][Level] >= 0) {
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
if(!strlen(tmp)) return SendClientMessage(playerid, red, "USE: /veh [modelo/nombre] [color1] [color2]");
new car, colour1, colour2, string[128];
if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
if(car < 400 || car == 425 || car == 432 || car == 447 || car == 520 || car > 611) return SendClientMessage(playerid, red, "ERROR: Modelo de vehiculo invalido");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1; GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle); int1 = GetPlayerInterior(playerid);
LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
PlayerInfo[playerid][pCar] = LVehicleID;
format(string, sizeof(string), "%s ha aparecido un \"%s\" (Modelo:%d) color (%d, %d), el %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
SaveToFile("CarSpawns",string);
format(string, sizeof(string), "Has aparecido un \"%s\" (Modelo:%d) color (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
return SendClientMessage(playerid,lightblue, string);
} else return SendClientMessage(playerid,red,"ERROR: Nesesitas Mas Nivel De Admin Para Este Comando");
}