- 0
Problema
-
Similar Content
-
Problema turf
By Soryn.,
- 3 answers
- 261 views
-
- 1 reply
- 179 views
-
Problema
By ImJustSlim,
- 3 answers
- 286 views
-
- 2 replies
- 157 views
-
- 1 answer
- 312 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.
Question
xDelta
Am GameMode GTA.THEG.RO si cand dau /acreatecar imi apare dialogul sa pun numele persoanei care doresc sa ii dau masina, scriu numele apoi cand dau ENTER imi zice:
ERROR. That car is not a ownable car.
Uitate scriptul:
if(dialogid==DIALOGIDSETOWNER)
{
if(response)
{
new pcname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pcname,13);
if(IsPlayerInVehicle(playerid,idcar))
{
if(IsAnOwnableCar(idcar))
{
if(strlen(inputtext))
{
giveplayerid = ReturnUser(inputtext);
if(PlayerInfo[giveplayerid][pPcarkey] == -1) { }
else if(PlayerInfo[giveplayerid][pPcarkey2] == -1) { }
else { SendClientMessage(playerid, COLOR_GREY, " That player allready have 2 cars"); return 1; }
if(CarInfo[idcar][cOwned]==1)
{
SendClientMessage(playerid, COLOR_GREY, "Someone already owns this car");
return 1;
}
if(PlayerInfo[giveplayerid][pPcarkey] == -1) { PlayerInfo[giveplayerid][pPcarkey] = idcar; }
else if(PlayerInfo[giveplayerid][pPcarkey2] == -1) { PlayerInfo[giveplayerid][pPcarkey2] = idcar; }
else { return 1; }
CarInfo[idcar][cOwned] = 1;
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
strmid(CarInfo[idcar][cOwner], sendername, 0, strlen(sendername), 999);
SavePlayerData(giveplayerid);
OnCarUpdate();
format(string,128, " Personal car set to %s",sendername);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}
else SendClientMessage(playerid, COLOR_GREY, " ERROR. That car is not a ownable car");
}
else SendClientMessage(playerid, COLOR_GREY, " You must be in ownable vehicle to set a personal car");
}
else return 1;
}[
Si aici este comanda:
if(strcmp(cmd, "/acreatecar", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] == 1339)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");
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]");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 || color1 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 252 !"); return 1; }
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /acreatecar [carid] [culoare1] [culoare2]");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 || color2 > 252) { SendClientMessage(playerid, COLOR_WHITE, " Color Number can't be below 0 or above 252 !"); return 1; }
new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
new thiscar = CreateVehicle(car,X,Y,Z,1,color1,color2,99999999);
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;
PutPlayerInVehicle(playerid,thiscar,0);
strmid(CarInfo[vehid][cOwner], "No-one", 0, strlen("No-one"), 999);
format(CarInfo[thiscar][cDescription], 32, "%s",vehName[GetVehicleModel(GetPlayerVehicleID(playerid))-400]);
format(string, sizeof(string), "The car %s [%d] has been created",CarInfo[thiscar][cDescription],thiscar);
SendClientMessage(playerid, COLOR_BLUE, string);
ShowPlayerDialog(playerid,DIALOGIDSETOWNER,DIALOG_STYLE_INPUT,"{E0941B}Vehicle owner","Write playerid/PartOfName \nto make owner this car:","Enter","Close");
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!");
return 1;
}
}
Ma poate ajuta cineva?
Link to comment
Share on other sites
7 answers to this question
Recommended Posts