Jump to content
  • 0

comanda


sorinel2011

Question

3 answers to this question

Recommended Posts

Incearca asa

CMD:car(playerid,params[]) {
    SendClientMessage(playerid,red, "Already drive a car. Out of the car and try again.");
    }
    else
	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 SendUsage(playerid,"/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, "ERROR: Invalid Vehicle Model");
		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 = AddStaticVehicleEx(car, X+3,Y,Z, Angle, colour1, colour2, 60); PutPlayerInVehicle(playerid, LVehicleID, 0); LinkVehicleToInterior(LVehicleID,int1);
		PlayerInfo[ playerid ][pCar] = LVehicleID;
		format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
        SaveToFile("CarSpawns",string);
		format(string, sizeof(string), "~w~~h~Vehicle Spawned! ~b~~h~Model: ~r~~h~%s", VehicleNames[car-400], car, colour1, colour2);
		return Info(playerid,string);
	return 1;
}

Massari e curva mea

Link to comment
Share on other sites

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.