30.08.2012, 16:49
I'm trying to make an /import command, but will something like this work?
pawn Код:
CMD:import(playerid, params[])
{
new string[128], weapon[32], amount, drugs[32];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to login first before using any command.");
if(!PlayerInfo[playerid][pFam]) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You have to be in a offical organisation.");
if(sscanf(params, "s[32]", weapon))
{
SCM(playerid, COLOR_WHITE, "USAGE: /import [weapon/drugs]");
return 1;
}
if(!strcmp(params, "weapon", true))
{
if(!PlayerInfo[playerid][pFam]) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You have to be in a offical organisation.");
{
if(sscanf(params, "s[32]d", weapon, amount))
{
SCM(playerid, COLOR_WHITE, "USAGE: /import [weapon] [amount]");
return 1;
}
}
}
if(!strcmp(params, "drugs", true))
{
if(!PlayerInfo[playerid][pFam]) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You have to be in a offical organisation.");
{
if(sscanf(params, "s[32]d", drugs, amount))
{
SCM(playerid, COLOR_WHITE, "USAGE: /import [drugs] [amount]");
return 1;
}
}
}
return 1;
}