- 0
Cum transform comanda in dialog?
-
Similar Content
-
Comanda /spec
By VAurel,
- 4 answers
- 213 views
-
- 2 replies
- 513 views
-
- 4 answers
- 585 views
-
- 3 replies
- 252 views
-
- 3 replies
- 215 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
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