ZCMD error -
cotyzor - 26.10.2012
Код:
command(editpricecar, playerid, params[])
{
new string[128];
new price, carid;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(PlayerData[playerid][pAdmin] >= 6)
{
if(sscanf(params, "ud", id, price))
{
SendUsage(playerid,"/editpricecar [carid] [value]");
}
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);
}
else return SendClientMessage(playerid, GREY, AdminOnly);
return 1;
}
I can't use this command
Re: ZCMD error -
cotyzor - 26.10.2012
I'd tried to edit but didn't work
Код:
command(editpricecar, playerid, params[])
{
new string[128];
new price, carid;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(PlayerData[playerid][pAdmin] < 6) return SendClientMessage(playerid, GREY, AdminOnly);
else if(sscanf(params, "ud", id, price)) return SendUsage(playerid,"/editpricecar [carid] [value]");
else if(carid <= PreVehicle)
{
format(string, sizeof(string), "Server: Masinile personala au id-ul de la %d +",PreVehicle);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else if(price < 1) return SendClientMessage(playerid, COLOR_GRAD1,"Server: Pretul trebuie sa fie mai mare de 1$");
else if(CarData[carid-PreVehicle][cModel] < 400 || CarData[carid-PreVehicle][cModel] > 611) return SendClientMessage(playerid, COLOR_GRAD1,"Server: Aceasta masina nu este personala! Este creata cu /veh");
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;
}
Re: ZCMD error -
CoDeZ - 26.10.2012
Код:
CMD:editpricecar(playerid, params[])
{
new string[128];
new price, carid;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(PlayerData[playerid][pAdmin] >= 6)
{
if(sscanf(params, "ud", id, price)) return SendUsage(playerid,"/editpricecar [carid] [value]");
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) return SendClientMessage(playerid, COLOR_GRAD1,"Server: Pretul trebuie sa fie mai mare de 1$");
if(CarData[carid-PreVehicle][cModel] < 400 || CarData[carid-PreVehicle][cModel] > 611) return SendClientMessage(playerid, COLOR_GRAD1,"Server: Aceasta masina nu este personala! Este creata cu /veh");
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);
}
else return SendClientMessage(playerid, GREY, AdminOnly);
}
try this
Re: ZCMD error -
cotyzor - 26.10.2012
Doesn't work
Re: ZCMD error -
gtakillerIV - 26.10.2012
You got an error yeah?
Line is:
PHP код:
else return SendClientMessage(playerid, GREY, AdminOnly);
It should be:
PHP код:
else return SendClientMessage(playerid, GREY, "AdminOnly");
Re: ZCMD error -
cotyzor - 26.10.2012
No ... In top of the script I put:
pawn Код:
#define AdminOnly "{FFFFFF}Error: Your Admin level is too low"
Re: ZCMD error -
cotyzor - 27.10.2012
pawn Код:
command(editpricecar, playerid, params[])
{
new string[128];
new price, carid;
new PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
if(PlayerData[playerid][pAdmin] < 6) return SendClientMessage(playerid, GREY, AdminOnly);
else if(sscanf(params, "ud", carid, price)) return SendUsage(playerid,"/editpricecar [carid] [value]");
else if(carid <= PreVehicle) return SendClientMessage(playerid, COLOR_WHITE, "Server: Wrong CarID");
else if(price < 1) return SendClientMessage(playerid, COLOR_GRAD1,"Server: Pretul trebuie sa fie mai mare de 1$");
else if(CarData[carid-PreVehicle][cModel] < 400 || CarData[carid-PreVehicle][cModel] > 611) return SendClientMessage(playerid, COLOR_GRAD1,"Server: Aceasta masina nu este personala! Este creata cu /veh");
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;
}
Re: ZCMD error -
gtakillerIV - 27.10.2012
Can you explain to us what happens when you try the command?
Re: ZCMD error -
Gangster-rocks - 27.10.2012
pawn Код:
else return SendClientMessage(playerid, GREY, AdminOnly);
should be
pawn Код:
else
{
new str[100];
format(str,sizeof(str),"%s",AdminOnly);
return SendClientMessage(playerid, GREY, str);
}
Re: ZCMD error -
JaKe Elite - 27.10.2012
^^
His way should work too.