Jump to content
  • 0

/car [name]


Ryder_RO

Question

sal

cum pot face ca comanda asta orice player so foloseasca (sa nu trb admin)

dcmd_car(playerid,params[]) {
	if(PlayerInfo[playerid][Level] >= 3) {
	    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, "FOLOSESTE: /car [Modelid/Nume] [Culoare1] [Culoare2]");
		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, "EROARE: Modelul vehiculului necunoscut");
		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;
		CMDMessageToAdmins(playerid,"CAR");
		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), "Tu ai spwanat un \"%s\" (Model:%d) Culoare (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
		return SendClientMessage(playerid,lightblue, string);
	} else return SendClientMessage(playerid,red,"EROARE: Trebuie sa fi Administrator Level 3 pentru a folosi aceasta comanda");
}

Multumesc!

468833_437698_362328_hiphop.jpg
Link to comment
Share on other sites

9 answers to this question

Recommended Posts

Guest PlayON

Sterge

[pawn]if(PlayerInfo[playerid][Level] >= 3) {[/pawn]

si

[pawn]} else return SendClientMessage(playerid,red,"EROARE: Trebuie sa fi Administrator Level 3 pentru a folosi aceasta comanda");[/pawn]

Link to comment
Share on other sites

RuNix" post="73345" timestamp="1305976905"]

in ladmin , lux admin tot porcaria aia  :huh:

mai bine pune in loc de

if(PlayerInfo[playerid][Level] >= 3) {
asa
if(PlayerInfo[playerid][Level] >= 0) {

fara sa modificati ca sa va dea erori ... :)

runix are dreptate e mai simplu asa stergi degeaba liniile alea  :embarrassed:

<a href=http://devilone.ro>

devilone-banner.png</a>

Link to comment
Share on other sites

Guest PlayON

O fi mai simplu dar e un check facut degeaba! Va luati dupa runix, ala care alege metoda usoara nu cea corecta.

dsteptilor! Ascultati de ala care stie ce zice.

Link to comment
Share on other sites

ma mie nu mia dat erors cand am sters alea asa ca .....

fiecare aveti dreptate si cum a zis 0 si cum a zis Runix

Sigur ai comanda aia in scriptul de admin ?

Oricum, uite cum e corect:

dcmd_car(playerid,params[]) 
{
    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, "FOLOSESTE: /car [Modelid/Nume] [Culoare1] [Culoare2]");
	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, "EROARE: Modelul vehiculului necunoscut");
	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;
	CMDMessageToAdmins(playerid,"CAR");
	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), "Tu ai spwanat un \"%s\" (Model:%d) Culoare (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
	return SendClientMessage(playerid,lightblue, string);
}

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.