10.01.2014, 12:21
I am trying to convert this command to mysql but i am very new to mysql and i cant i dont know how.
Can somebody give me an example?
Can somebody give me an example?
pawn Код:
COMMAND:fillhqstock(playerid)
{
if(PlayerInfo[playerid][playerteam] == CIV) return SendClientError(playerid, CANT_USE_CMD);
new fname[40];
format(fname, sizeof(fname), "/Factions/Faction-%s.txt", PlayerInfo[playerid][PTeamName]);
new pCar = GetPlayerVehicleID(playerid);
if(GetVehicleModel(pCar) != 482) return SendClientError(playerid, "You have to be in a Burrito!");
if(vehicleGuns[pCar] == 0 || vehicleBullets[pCar] == 0) return SendClientError(playerid, " You either don't have guns or bullets!");
if(GetVehiclePeople(pCar) < 3) return SendClientError(playerid, "You need atleast 3 people in your van!");
if(!IsAtOwnHQ(playerid)) return SendClientError(playerid, "You are not at your own HQ!");
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientError(playerid, "You are not the driver!");
if(dini_Int(fname, "fguns") >= dini_Int(fname, "fgunstock")) return SendClientError(playerid, "Your stock is full!");
vehicleBullets[pCar] = 0;
vehicleGuns[pCar] = 0;
dini_IntSet(fname, "fpoints", dini_Int(fname, "fpoints") + 30);
dini_IntSet(fname, "fguns", dini_Int(fname, "fguns") + 20);
SendClientMessage(playerid, COLOR_LIGHTGREY, " Excellent, the stock has been filled. See /finfo to see the status!");
SendClientMessage(playerid, COLOR_LIGHTGREY, " Your faction received: +20 weapons in the stock & +30 fpoints!");
SendClientMessage(playerid, COLOR_LIGHTGREY, " You received: $51.500");
GivePlayerMoneyEx(playerid, 51500);
format(iStr, sizeof(iStr), "# [%s] %s has filled the faction stock. (+20 weapons | +30 fpoints)", PlayerInfo[playerid][PTeamName], RPName(playerid));
SendClientMessageToTeam(PlayerInfo[playerid][playerteam],iStr,COLOR_PLAYER_VLIGHTBLUE);
return 1;
}