KAPSu Posted May 26, 2013 Report Share Posted May 26, 2013 Cand vreau sa creez una imi spune Masina 742 a fost creeata cu succes si apoi nu imi aprare nimic.Nici masina , nici sa scriu /v buy ca si cum as cumparao.Aceasta este comanda:[pawn]if(strcmp(cmd, "/acreatecar", true) == 0) { if(PlayerInfo[playerid][pAdmin] >= 1338) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]"); return 1; } new car; car = strval(tmp); if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Vehicle Number can't be below 400 or above 611 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]"); return 1; } new color1; color1 = strval(tmp); if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 126 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]"); return 1; } new color2; color2 = strval(tmp); if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 126 !"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]"); return 1; } new value; value = strval(tmp); new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z); new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999); format(CarInfo[thiscar][cLicense], 32 ,"ForSale"); SetVehicleNumberPlate(vehid,CarInfo[thiscar][cLicense]); CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2; CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1; CarInfo[thiscar][cValue] = value; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1; LoadComponents(thiscar); PutPlayerInVehicle(playerid,thiscar,0); strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999); format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]); format(string, sizeof(string), " Masina %d a fost creata cu succes!.", thiscar); SendClientMessage(playerid, COLOR_BLUE, string);[/pawn]Imi puteti pune in comanda CreateVehicle va rog ? Cel din urma va fi cel dintâi. Link to comment Share on other sites More sharing options...
Gireada Posted May 26, 2013 Report Share Posted May 26, 2013 Ia seteazati virtualul 0 si vezi daca merge Link to comment Share on other sites More sharing options...
KAPSu Posted May 27, 2013 Author Report Share Posted May 27, 2013 Am rezolvat era de la masini! Trebuia sa scriu cate masini sunt pe server in total si am gresit numarul , am rezolvat puteti da T/C !Multumesc oricum Gireada ! Cel din urma va fi cel dintâi. Link to comment Share on other sites More sharing options...
Question
KAPSu
Cand vreau sa creez una imi spune Masina 742 a fost creeata cu succes si apoi nu imi aprare nimic.Nici masina , nici sa scriu /v buy ca si cum as cumparao.
Aceasta este comanda:
[pawn]if(strcmp(cmd, "/acreatecar", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
return 1;
}
new car;
car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, " Vehicle Number can't be below 400 or above 611 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
return 1;
}
new value;
value = strval(tmp);
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999);
format(CarInfo[thiscar][cLicense], 32 ,"ForSale");
SetVehicleNumberPlate(vehid,CarInfo[thiscar][cLicense]);
CarInfo[thiscar][cOwned] = 0; CarInfo[thiscar][cModel] = car; CarInfo[thiscar][cColorOne] = color1; CarInfo[thiscar][cColorTwo] = color2;
CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
CarInfo[thiscar][cValue] = value; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1; LoadComponents(thiscar);
PutPlayerInVehicle(playerid,thiscar,0);
strmid(CarInfo[vehid][cOwner], "Dealership", 0, strlen("Dealership"), 999);
format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
format(string, sizeof(string), " Masina %d a fost creata cu succes!.", thiscar);
SendClientMessage(playerid, COLOR_BLUE, string);[/pawn]
Imi puteti pune in comanda CreateVehicle va rog ?
Cel din urma va fi cel dintâi.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts