Other Problem - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Other Problem (
/showthread.php?tid=204720)
Other Problem -
Fool - 30.12.2010
Hello again, i have 2 stuff i fucked up in, 1 is fixed, and other one is fixed, i fixed it, but this one keeps annoying me
Its a /Sethit Command:
Код:
if(headamount < 20000 || headamount > 10000001)
return SendClientMessage(playerid,COLOR_WHITE, "Min/Max hit contract amount is $20000 - $1000000");
else
if i insert like
/sethit 0 20001 it will resend.
is there a FIX?
BTW: i dont get warnings/errors.
Re: Other Problem -
Jeffry - 30.12.2010
Post the full command please.
Re: Other Problem -
Fool - 30.12.2010
Quote:
Originally Posted by Jeffry
Post the full command please.
|
Fine Jeffry, you wont like it derp.
pawn Код:
dcmd_Sethit(playerid,params[])
{
new
target, string[128], headamount;
if(PlayerInfo[playerid][IsHitman] == 1)
SendClientMessage(playerid,red,"Hitman Cant Put Hits On People you retard.");
if(PlayerInfo[playerid][IsCop] == 1)
return SendClientMessage(playerid,red,"Cops can't offer cash for kills!");
if(sscanf(params, "uz", target, headamount))
return SendClientMessage(playerid,red,"USAGE: /Sethit [Target ID] [Cash amount]");
// if(target == playerid)
// return SendClientMessage(playerid,red,"Looks Like You Hate Yourself. WE HATE YOU!");
if(!IsPlayerConnected(target))
return SendClientMessage(playerid,red,"Invalid playerid or name!");
if(GetPlayerMoney(playerid) < headamount)
return SendClientMessage(playerid,red,"You can't afford that!");
if(headamount < 20000 || headamount > 10000001)
return SendClientMessage(playerid,COLOR_WHITE, "Min/Max hit contract amount is $20000 - $1000000");
else
{
PlayerInfo[target][HeadCash] = headamount;
SendClientMessage(playerid,COLOR_WHITE,"Hit has been set.");
for (new i=0; i<MAX_PLAYERS+1; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[i][IsHitman] == 1)
{
format(string, sizeof(string), "%s(%d) put a Hit on %s(%d)'s kill him and get %s",PlayerName(playerid),playerid,PlayerName(target),target,headamount);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
SendClientMessageToAll(COLOR_WHITE,string);
}
}
}
}
return true;
}
Re: Other Problem -
_rAped - 30.12.2010
Oh lolz. There's too much 0s.
Try:
pawn Код:
dcmd_Sethit(playerid,params[])
{
new
target, string[128], headamount;
if(PlayerInfo[playerid][IsHitman] == 1)
SendClientMessage(playerid,red,"Hitman Cant Put Hits On People you retard.");
if(PlayerInfo[playerid][IsCop] == 1)
return SendClientMessage(playerid,red,"Cops can't offer cash for kills!");
if(sscanf(params, "uz", target, headamount))
return SendClientMessage(playerid,red,"USAGE: /Sethit [Target ID] [Cash amount]");
// if(target == playerid)
// return SendClientMessage(playerid,red,"Looks Like You Hate Yourself. WE HATE YOU!");
if(!IsPlayerConnected(target))
return SendClientMessage(playerid,red,"Invalid playerid or name!");
if(GetPlayerMoney(playerid) < headamount)
return SendClientMessage(playerid,red,"You can't afford that!");
if(headamount < 20000 || headamount > 1000001)
return SendClientMessage(playerid,COLOR_WHITE, "Min/Max hit contract amount is $20000 - $1000000");
else
{
PlayerInfo[target][HeadCash] = headamount;
SendClientMessage(playerid,COLOR_WHITE,"Hit has been set.");
for (new i=0; i<MAX_PLAYERS+1; i++)
{
if (IsPlayerConnected(i))
{
if(PlayerInfo[i][IsHitman] == 1)
{
format(string, sizeof(string), "%s(%d) put a Hit on %s(%d)'s kill him and get %s",PlayerName(playerid),playerid,PlayerName(target),target,headamount);
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
SendClientMessageToAll(COLOR_WHITE,string);
}
}
}
}
return true;
}
Re: Other Problem -
MadeMan - 30.12.2010
pawn Код:
if(sscanf(params, "ud", target, headamount))
Re: Other Problem -
Fool - 30.12.2010
Thanks! hope this works.