- 0
Bug save color&park
-
Similar Content
-
- 7 replies
- 635 views
-
- 10 answers
- 3.216 views
-
- 3 answers
- 890 views
-
- 16 answers
- 2.615 views
-
-
Recently Browsing 0 members
- No registered users viewing this page.

Question
Madu99
Bug la masinile personale .Cand dau /v park sau /v color nu se salveaza....Se salveaza doar dupa rr la server si cand dau rr la sv se incurca idurile masinilor personale.
[pawn] if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SendClientMessage(playerid, COLOR_GREY, " You need to login first ! ");
return 1;
}
if(PlayerInfo[playerid][pCarBan] == 1)
{
SendClientMessage(playerid, COLOR_GREY, " You'r banned to use /v commands ! ");
return 1;
}
if(PlayerInfo[playerid][pLevel] >= 3 && PlayerInfo[playerid][pConnectTime] >= 10)
{
new x_nr[64];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
SendClientMessage(playerid, COLOR_WHITE, "Available names: park, color, create");
return 1;
}
else if(strcmp(x_nr,"park",true) == 0)
{
if(PlayerInfo[playerid][pCar] == 9999)
{
SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new carid = GetPlayerVehicleID(playerid);
if(carid == PlayerInfo[playerid][pCar])
{
new Float:x,Float:y,Float:z;
new Float:a;
GetPlayerName(playerid, playername, sizeof(playername));
GetVehiclePos(carid, x, y, z);
GetVehicleZAngle(carid, a);
CarInfo[carid][cLocationx] = x;
CarInfo[carid][cLocationy] = y;
CarInfo[carid][cLocationz] = z;
CarInfo[carid][cAngle] = a;
format(string, sizeof(string), "{FFFFFF}Masina ta a fost salvata {FF3333}%f.01, %f.01, %f.01, Tine minte ! La RR va fi spawnata aici!",x,y,z);
SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
SaveCar(carid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
return 1;
}
return 1;
}
else if(strcmp(x_nr,"color",true) == 0)
{
if(PlayerInfo[playerid][pCar] == 9999)
{
SendClientMessage(playerid, COLOR_GREY,"* You don't have a vehicle to respray.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Folosire: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
return 1;
}
new color1;
color1 = strval(tmp);
if(color1 < 0 && color1 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "Folosire: /v color [ColorOneID] [ColorTwoID] (50.000$ cost)");
return 1;
}
new color2;
color2 = strval(tmp);
if(color2 < 0 && color2 > 126)
{
SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
return 1;
}
if(GetPlayerMoney(playerid) < 50000)
{
SendClientMessage(playerid, COLOR_GREY, " Nu ai suficienti bani!");
return 1;
}
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
new vehid = GetPlayerVehicleID(playerid);
if(CarInfo[vehid][cID] == PlayerInfo[playerid][pCar])
{
CarInfo[vehid][cColorOne] = color1;
CarInfo[vehid][cColorTwo] = color2;
ChangeVehicleColor(vehid, color1, color2);
GivePlayerMoney(playerid, -50000);
SendClientMessage(playerid, COLOR_WHITE, "{FF3333}Ti-ai modificat culoarea!");
SaveCar(vehid);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in your car.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You'r not in a car.");
return 1;
}
return 1;
}[/pawn]
1 answer to this question
Recommended Posts