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;
}
if (price > 1000000) return SendClientMessage(playerid, X11_TOMATO_2, "Max price is 1 million");
Paste this right after your sscanf-line:
pawn Код:
|