[HELP]GangSafe - 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: [HELP]GangSafe (
/showthread.php?tid=112733)
[HELP]GangSafe -
Lilcuete - 09.12.2009
When i do /safestoremats and the ammount it says "unknown command"to the place and i am heres the command
Код:
if(strcmp(cmd, "/safestoremats", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new family = PlayerInfo[playerid][pFMember];
if(PlayerInfo[playerid][pFMember] == 255)
{
SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
return 1;
}
if(PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new potdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (potdeposit > PlayerInfo[playerid][pMats] || potdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
return 1;
}
if(GangSafe(playerid))
{
PlayerInfo[playerid][pMats] -= potdeposit;
FamilyInfo[family][sMats]=potdeposit+FamilyInfo[family][sMats];
SendClientMessage(playerid, COLOR_WHITE, "|___ SAFE STATMENT ___|");
format(string, sizeof(string), " Deposit: %d Materials",potdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " New Balance: %d Materials", FamilyInfo[family][sMats]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
}
}
}
Please help thanks
Re: [HELP]GangSafe -
Lilcuete - 17.12.2009
BUMPED
Re: [HELP]GangSafe -
GTAguillaume - 18.12.2009
What if you add a 'return 1;' on the penultimate line?
(sorry for my english

)
Re: [HELP]GangSafe -
Lilcuete - 18.12.2009
what do u mean?
Re: [HELP]GangSafe -
GTAguillaume - 18.12.2009
Код:
if(strcmp(cmd, "/safestoremats", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new family = PlayerInfo[playerid][pFMember];
if(PlayerInfo[playerid][pFMember] == 255)
{
SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
return 1;
}
if(PlayerInfo[playerid][pMember] == 1)
{
SendClientMessage(playerid,COLOR_GREY,"You are not in a gang !");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
new potdeposit = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /safestoremats [amount]");
format(string, sizeof(string), " You Have %d Materials in your Safe.", FamilyInfo[family][sMats]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if (potdeposit > PlayerInfo[playerid][pMats] || potdeposit < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You dont have that much");
return 1;
}
if(GangSafe(playerid))
{
PlayerInfo[playerid][pMats] -= potdeposit;
FamilyInfo[family][sMats]=potdeposit+FamilyInfo[family][sMats];
SendClientMessage(playerid, COLOR_WHITE, "|___ SAFE STATMENT ___|");
format(string, sizeof(string), " Deposit: %d Materials",potdeposit);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " New Balance: %d Materials", FamilyInfo[family][sMats]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
}
}
return 1;
}
Re: [HELP]GangSafe -
Lilcuete - 18.12.2009
im going to test
Re: [HELP]GangSafe -
Lilcuete - 18.12.2009
Ok now it works but when i do it nothing pops up
Re: [HELP]GangSafe -
Lilcuete - 18.12.2009
?
Re: [HELP]GangSafe -
GTAguillaume - 18.12.2009
Are you sure thet GangSafe(playerid) return a 1?