13.10.2014, 17:24
(
Последний раз редактировалось Akcent_Voltaj; 13.10.2014 в 19:06.
)
how can I make so when player puts plate so no body can put it again?/
PHP код:
else if(strcmp(x_nr,"setplate",true) == 0)
{
new name[MAX_PLAYER_NAME+1];
new Player[128];
GetPlayerName(playerid, name, sizeof(name));
format(Player,sizeof(Player),"/Inmatriculari/%s.txt",cmdtext[idx]);
new File: hFile = fopen(Player, io_read);
if (hFile)//that works.
{
SendClientMessage(playerid, COLOR_RED, "Acest Numar Exista!");
fclose(hFile);
}
new Player[50];
format(Player,sizeof(Player),"/Inmatriculari/%s.txt",cmdtext[idx]);
new File: hFile = fopen(Player, io_write);
if (hFile)//that works.
{
if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
else { SendClientMessage(playerid, COLOR_GREY, " Trebuie sa fi in masina ta!"); return 1; }
{
if(cmdtext[idx++] != 32 || cmdtext[idx] == EOS)
{
SendClientMessage(playerid,0xFFFFFFAA,"{00A1FF}USAGE{FFFFFF}: /v setplate [newplate]");
return 1;
}
SetPVarInt(playerid, "VehicleRepair", 1);
new Float:XX,Float:YY,Float:ZZ,Float:AA;
new Float:CarHP, Float:OldCarHP;
new panels,doors,lights,tires;
GetVehicleHealth(vehid, CarHP);
GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
OldCarHP = CarHP;
format(CarInfo[vehid][cLicense], 32 ,"%s",cmdtext[idx]);
SetVehicleNumberPlate(vehid,CarInfo[vehid][cLicense]);
GetVehiclePos(vehid,XX,YY,ZZ);
GetVehicleZAngle(vehid, AA);
GivePlayerCash(playerid, -8000);
SetVehicleToRespawn(vehid);
SetVehiclePos(vehid,XX,YY,ZZ);
SetVehicleZAngle(vehid, AA);
PutPlayerInVehicle(playerid,vehid,0);
SetVehicleHealth(vehid, OldCarHP);
UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
format(string, sizeof(string), "Ti-ai inmatriculat vehicolul numarul este : %s - (te-a costat 8000Lei)", CarInfo[vehid][cLicense]);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
SendClientMessage(playerid, COLOR_RED, "Daca esti din Sibiu puneti nr de inmatriculare SB XX XXX. SB (2 cifre)(3 litere) - NUI VOIE LS/SF/LV.");
SendClientMessage(playerid, COLOR_YELLOW, "Poti si asa SB-XX-XXX sau fara - - - daca tio prinde tcc si este inmatriculata gresit tio tracteaza");
SendClientMessage(playerid, COLOR_BLUE, "Nu-ti pune de ex: SB 22 PLM - este interzis si poti primi Ban Permanent!");
OnPropUpdate(); SavePlayerData(playerid);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s si-a inmatriculat vehicolul [%s VehID: %d] cu numarul: %s",d,m,y,h,mi,s,sendername,model,vehid,CarInfo[vehid][cLicense]);
InmatriculariLog(string);
printf("/v setplate");
fclose(hFile);
return 1;
}
}
}