- 0
Cum transform comanda in dialog?
-
Similar Content
-
- 5 replies
- 258 views
-
- 2 answers
- 160 views
-
- 2 answers
- 156 views
-
- 1 answer
- 176 views
-
- 12 replies
- 3,136 views
-
-
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
DeLeT.
Cum as putea transforma comanda intr-un dialog cu imput si anume, dupa ce dai /v create sa apara un dialog in care sa scri in el carid, culoare 1, culoarea2 iar apoi sa iti dea masina.
if(strcmp(x_nr,"create",true) == 0)
{
if(PlayerInfo[playerid][pLevel] >= 2)
{
if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /v create [carid] [color1] [color2]"); return 1; }
new car = strval(tmp);
if(car < 400 || car > 611) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Vehicle Number can't be below 400 or above 611 !"); return 1; }
if(IsInvalidVehicleId(car) == 0)
{
SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle model !"); return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /v create [carid] [color1] [color2]"); return 1; }
new color1 = strval(tmp);
if(color1 < 0 || color1 > 126) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "USAGE: /v create [carid] [color1] [color2]"); return 1; }
new color2 = strval(tmp);
if(color2 < 0 || color2 > 126) { SendClientMessage(playerid, COLOR_WHITE, "{0950F7}* Color Number can't be below 0 or above 126 !"); return 1; }
new thiscar, Float:X, Float:Y, Float:Z;
GetPlayerPos(playerid, X, Y, Z);
GetPlayerName(playerid, sendername, sizeof(sendername));
thiscar = CreateVehicle(car, X, Y, Z, 1, color1, color2, -1);
strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999);
format(CarInfo[thiscar][cDescription], 32, "%s", vehName[GetVehicleModel(thiscar) - 400]);
CarInfo[thiscar][cOwned] = 1;
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][paintjob] = -1;
if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
format(TextCar, sizeof(TextCar), "{EE1111}Proprietar: {0099FF}• %s •", CarInfo[thiscar][cOwner]);
TextUpCar[thiscar] = Create3DTextLabel(TextCar, 0x33AAFFFF , 0.0, 0.0, 0.0, 25, 0, 1);
Attach3DTextLabelToVehicle(TextUpCar[thiscar], thiscar, 0.0, 0.0, 0.1);
LoadComponents(thiscar), OnCarUpdate(), SavePlayerData(playerid);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Ai deja o masina creeata de tine !");
}
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Trebuie sa ai level 2 !");
}
return 1;
}
Link to comment
Share on other sites
3 answers to this question
Recommended Posts