03.03.2019, 07:40
PHP код:
if(sscanf(cmdtext, "s[30]S()[30]S()[12]", szCmdInfo, szActionInfo,szSubActionInfo,szDepositInfo))
{
SendClientMessage(playerid, -1, "USAGE: /fsafe [Action]");
SendClientMessage(playerid, -1, "Available Actions: check, deposit, withdraw");
return 1;
}
if(!strcmp(szCmdInfo, "deposit", true)){
// Deposit here:
if(sscanf(szActionInfo, "s[30]", szDepositInfo)) {
SendClientMessage(playerid, -1, "Available Actions: {FFFFFF}money, weapon");
return SendClientMessage(playerid, -1, "/fsafe deposit [Action]");
}
if(!strcmp(szActionInfo, "money", true)){
if(sscanf(szDepositInfo, "i", amount)) return SendClientMessage(playerid, -1, "/fsafe deposit money [amount]");
if(amount<=0) return SendClientMessage(playerid, COLOR_RED, "Error:{FFFFFF} Amount cannot be less than $1.");
GiveMoney(playerid,-amount);
FamilyInfo[id][family_money] +=amount;
format(m, sizeof(m), "You have successfully deposited $%i in your family safe. Current family safe cash $%i.", amount,FamilyInfo[id][family_money]);
SendClientMessage(playerid, COLOR_GREY, m);
}
if(!strcmp(szActionInfo, "weapon", true)){
if(GetPlayerWeapon(playerid)==30||GetPlayerWeapon(playerid)==24||GetPlayerWeapon(playerid)==34||GetPlayerWeapon(playerid)==31){
switch(GetPlayerWeapon(playerid)){
case 30:{
RemovePlayerWeapon(playerid,30);
FamilyInfo[id][family_ak]++;
SendClientMessage(playerid, COLOR_GREEN, "Success:{FFFFFF} You've successfully deposited your AK-47.");
return 1;
}
}
}else{
return SendClientMessage(playerid, COLOR_RED, "Error:{FFFFFF} You can't store this weapon.");
}
}
}
when ever i do this command, it just send me this
PHP код:
if(sscanf(szDepositInfo, "i", amount)) return SendClientMessage(playerid, -1, "/fsafe deposit money [amount]");