Jump to content
  • 0

Nu merge comanda


Catalin # Valoare

Question

Problemă întâlnită (descriere):Nu imi merge comanda /editmodelcar
Ero(area / rile) / warning-(ul / urile):Nu imi da
Liniile de cod / sursa / script-ul:Nu e nevoie
Imagini / Video (optional):

if(strcmp(cmd, "/editmodelcar", true) == 0)
{
   if(PlayerData[playerid][pAdmin] < 8)
     {
    SendError(playerid,cmd);
       return 1;
}
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
   if(EsteManager(playerid))
   {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/editmodelcar [carid] [value]");
return 1;
}
new carid = strval(tmp);
       tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/editmodelcar [carid] [value]");
return 1;
}
new model = strval(tmp);
if(carid <= PreVehicle)
{
   format(string, sizeof(string), "Server: Masinile personala au id-ul de la %d +",PreVehicle);
SendClientMessage(playerid, COLOR_WHITE, string);
   return 1;
}
if(model < 400)
{
   SendClientMessage(playerid, COLOR_GRAD1,"Server: Modelul trebuie sa fie mai mare de 400");
return 1;
}
if(CarData[carid-PreVehicle][cModel] < 400 || CarData[carid-PreVehicle][cModel] > 611)
{
   SendClientMessage(playerid, COLOR_GRAD1,"Server: Aceasta masina nu este personala! Este creata cu /veh");
   return 1;
}
CarData[carid-PreVehicle][cModel] = model;
CreatedCar ++;
format(string, sizeof(string), " Tipe-ul masinii cu id %d este acum %d" , carid,model);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
format(string, sizeof(string), "UPDATE cars SET Model='%d' WHERE id=%d", CarData[carid-PreVehicle][cModel], carid-PreVehicle);
mysql_query(string);
return 1;
}
else
{
   SendClientMessage(playerid, COLOR_GRAD1,"Server: Error");
   return 1;
}
}

Aţi încercat să rezolvaţi singur?:Da,dar nu am reusit

Edited by WopsS
Adaugat tag-ul pawn.
Link to comment
Share on other sites

12 answers to this question

Recommended Posts

if(strcmp(cmd, "/editpricecar", true) == 0)
{
if(PlayerData[playerid][pAdmin] < 8)
{
SendError(playerid,cmd);
return 1;
}
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(EsteManager(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/editpricecar [carid] [value]");
return 1;
}
new carid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/editpricecar [carid] [value]");
return 1;
}
new price = strval(tmp);
if(carid <= PreVehicle)
{
format(string, sizeof(string), "Server: Masinile personala au id-ul de la %d +",PreVehicle);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
if(price < 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"Server: Pretul trebuie sa fie mai mare de 1&");
return 1;
}
if(CarData[carid-PreVehicle][cModel] < 400 || CarData[carid-PreVehicle][cModel] > 611)
{
SendClientMessage(playerid, COLOR_GRAD1,"Server: Aceasta masina nu este personala! Este creata cu /veh");
return 1;
}
CarData[carid-PreVehicle][cValue] = price;
format(string, sizeof(string), "Pretul masinii cu id-ul %d este acum %d" , carid,price);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);

DestroyVehicle(carid); // sau ce ai tu , modelu' masinii respective ( nu pune ex: 411 sau ceva de gen' )
format(string, sizeof(string), "UPDATE cars SET Value='%d' WHERE id=%d", CarData[carid-PreVehicle][cValue], carid-PreVehicle);

CreateVehicle(CarData[carid][carid] , x,y,z ); // a masinii etc... nu stiu functiile pe care le ai dar adaugi tu :) te descurci incearca asa
mysql_query(string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1,"Server: Error");
return 1;
}
}

Edited by Ph0eniX
public OnPlayerConnect(playerid)
{
	print("[ERROR] - Unable to establish a connection with the world...");
	SendRconCommand("exit");
	return 1;
}

 

Link to comment
Share on other sites

Comanda asta am copiat-o dupa asta.

if(strcmp(cmd, "/editpricecar", true) == 0)
{
if(PlayerData[playerid][pAdmin] < 8)
{
SendError(playerid,cmd);
return 1;
}
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(EsteManager(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/editpricecar [carid] [value]");
return 1;
}
new carid = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendUsage(playerid,"/editpricecar [carid] [value]");
return 1;
}
new price = strval(tmp);
if(carid <= PreVehicle)
{
format(string, sizeof(string), "Server: Masinile personala au id-ul de la %d +",PreVehicle);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
if(price < 1)
{
SendClientMessage(playerid, COLOR_GRAD1,"Server: Pretul trebuie sa fie mai mare de 1&");
return 1;
}
if(CarData[carid-PreVehicle][cModel] < 400 || CarData[carid-PreVehicle][cModel] > 611)
{
SendClientMessage(playerid, COLOR_GRAD1,"Server: Aceasta masina nu este personala! Este creata cu /veh");
return 1;
}
CarData[carid-PreVehicle][cValue] = price;
format(string, sizeof(string), "Pretul masinii cu id-ul %d este acum %d" , carid,price);
SendClientMessage(playerid,COLOR_LIGHTBLUE,string);
format(string, sizeof(string), "UPDATE cars SET Value='%d' WHERE id=%d", CarData[carid-PreVehicle][cValue], carid-PreVehicle);
mysql_query(string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1,"Server: Error");
return 1;
}
}

Asta e de editat pretul la masina.Numai ca eu am editat-o cu alea de model


cModel astea

Edited by WopsS
Adaugat codul pawn
Link to comment
Share on other sites

Merge, dar trebuie sa modifici si ID-ul masinii pe care o detine jucatorul si multe chestii care sa nu cauzeze bug-uri, gen daca masina nu e cumparata si un jucator vrea s-o cumpere, sa o treaca la dealer.

 

Problema asta trebuie s-o faci tu, daca nu te descurci postezi in alt topic. Nu te ajutam de la 0 s-o faci.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.