Jump to content
  • 0

Question

Posted

Deci am nevoie de un mic ajutor.

Atunci cand spawnez o masina cu /car o conduc etc... dar cand vreau sa spawnez alta masina cu /car , prima masina sa dispara si sa o spawneze pe a doua.

Inainte mergea chestia dar azi cand am pornit serveru nu a mers.

Spawnam o masina , dupa spawnam alta si prima masina disparea.

Car este

dcmd_car(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, "USAGE: /car [Modelid/Name] [colour1] [colour2]");

new car, colour1, colour2, string[128];

  if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);

if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "{FC0303}ERROR{00FF19}: {FC0303}Invalid ID!");

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, LVehicleWorld = GetPlayerVirtualWorld(playerid); GetPlayerPos(playerid, X,Y,Z); GetPlayerFacingAngle(playerid,Angle);  int1 = GetPlayerInterior(playerid);

LVehicleID = AddStaticVehicleEx(car, X+3,Y,Z, Angle, colour1, colour2, 60); SetVehicleNumberPlate(LVehicleID, "DrifteR"); PutPlayerInVehicle(playerid, LVehicleID, 0); LinkVehicleToInterior(LVehicleID,int1); SetVehicleVirtualWorld(LVehicleID, LVehicleWorld);

PutPlayerInVehicle(playerid, LVehicleID, 0);

        SaveToFile("CarSpawns",string);

format(string, sizeof(string), "{00FF19}You have spawned a {FC0303}\"%s\" {FFFFFF}({00FF19}Model:{FC0303}%d{FFFFFF})", VehicleNames[car-400], car);

return SendClientMessage(playerid,lightblue, string);

} else return SendClientMessage(playerid,red,"ERROR");

}

REZOLVAT ! Era din cauza la PutPlayerInVehicle!

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.