12.12.2014, 11:09
Hi I need to make this command to not to add more than 1m if someone try to enter a value above 1million it says you cant enter that much ammount the limit is 1m
PHP код:
YCMD:setcontract(playerid, params[], help) {
new user, price;
new faction = GetPVarInt(playerid, "Faction");
if(getFactionType(faction) != EFactionType_Hitman || GetPVarInt(playerid, "Rank") < 2) {
SendClientMessage(playerid, X11_TOMATO_2, "You aren't a member of hitman!");
return 1;
}
if(!sscanf(params, "k<playerLookup>d",user,price)) {
if(!IsPlayerConnectEx(user)) {
SendClientMessage(playerid, X11_TOMATO_2, "User not found");
return 1;
}
SetPVarInt(user, "Contract", price);
if(price != 0) {
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Contract Updated!");
} else {
SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Contract Removed!");
}
} else {
SendClientMessage(playerid, X11_WHITE, "USAGE: /setcontract [user] [price]");
}
return 1;
}