- 0
Problema /acreatecar
-
Similar Content
-
Recently Browsing 0 members
- No registered users viewing this page.
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.
Question
Vladisimo
Am si eu o problema la comanda /acreatecar dau de ex /acreatecar 501 1 1 321321 apare masina dar nu e de vanzare e daia la vrajeala dupa rr dispare :| precizez ca am tot sistemu de masini personale in gm doar ca nu aveam /acreatecar comanda pe care am adaugato eu dintr-un alt sistem identic :|
[pawn]public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(specplayer, 10, cmdtext);
dcmd(specoff, 7, cmdtext);
new string[256];
new playermoney;
new sendername[MAX_PLAYER_NAME];
new giveplayer[MAX_PLAYER_NAME];
new playername[MAX_PLAYER_NAME];
new cmd[256];
new tmp[256];
new giveplayerid, moneys, glasseid, skin, idx, id;
new idcar = GetPlayerVehicleID(playerid);
new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
cmd = strtok(cmdtext, idx);
if(strcmp(cmd, "/acreatecar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] >= 7)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /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, "USAGE: /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, "USAGE: /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, "USAGE: /acreatecar [carid] [culoare1] [culoare2] [Pretul]");
return 1;
}
new vehid;
vehid = GetPlayerVehicleID(playerid);
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);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
}[/pawn]
1 answer to this question
Recommended Posts