[Help] me with command. - 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)
+--- Thread: [Help] me with command. (
/showthread.php?tid=302742)
[Help] me with command. -
umarmalik - 10.12.2011
Can any one help me with that command, when I try in game its says [Server: Unknown command].
Any one Help me.
pawn Код:
if(strcmp(cmd,"/buymats",true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 23)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Arms Dealer. ");
return 1;
}
if(!PlayerToPoint(2.0, playerid, -1291.601806,2533.543212,87.742187))
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the materials bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buymats [ammount]");
return 1;
}
new mammount;
mammount = strval(tmp);
if(GetPlayerPCash(playerid) < mammount *2)
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough money ! ");
return 1;
}
if(mammount < 1 || mammount > 10000) { SendClientMessage(playerid, COLOR_GREY, " Cannot be below 0, and not more then 10,000!"); return 1; }
PlayerInfo[playerid][pMats] += mammount;
GivePlayerPCash(playerid, - mammount *2);
format(string, sizeof(string), " You have bought %d materials for %d$ !", mammount, mammount *2);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
return 1;
}
Re: [Help] me with command. - suhrab_mujeeb - 10.12.2011
pawn Код:
if (strcmp("/buymats", cmdtext, true, 10) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pJob] != 23)
{
SendClientMessage(playerid, COLOR_GREY, " You are not a Arms Dealer. ");
return 1;
}
if(!PlayerToPoint(2.0, playerid, -1291.601806,2533.543212,87.742187))
{
SendClientMessage(playerid, COLOR_GREY, " You are not at the materials bank !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buymats [ammount]");
return 1;
}
new mammount;
mammount = strval(tmp);
if(GetPlayerPCash(playerid) < mammount *2)
{
SendClientMessage(playerid, COLOR_GREY, " You don't have enough money ! ");
return 1;
}
if(mammount < 1 || mammount > 10000) { SendClientMessage(playerid, COLOR_GREY, " Cannot be below 0, and not more then 10,000!"); return 1; }
PlayerInfo[playerid][pMats] += mammount;
GivePlayerPCash(playerid, - mammount *2);
format(string, sizeof(string), " You have bought %d materials for %d$ !", mammount, mammount *2);
SendClientMessage(playerid, COLOR_GREY, string);
return 1;
}
return 1;
}
Re: [Help] me with command. -
umarmalik - 10.12.2011
Thank you bro. 1+ rep