Present system
#1

I got the command but when I type /gift crate [then gift type] the present is not created, any idea?

Code:
Код:
CMD:gift(playerid, params[])
{
    new option[32], type[32], string[100];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(PlayerInfo[playerid][pAdmin] <5) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
    if(sscanf(params, "s[32]", option))
    {
        SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /gift [option]");
        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Create, Remove");
        return 1;
    }
    if(!strcmp(option, "create", true))
    {
		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);
  		new File:presents=fopen("presents.cfg", io_append);
		format(string, sizeof(string), "%d, %d, %d\r\n", x, y, z);
  		fwrite(presents, string);
  		fclose(presents);
		if(sscanf(params, "s[32]s[32]", option, type))
	    {
	        SendClientMessage(playerid, COLOR_WHITE, "** [Usage]: /gift option [type]");
	        SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Gift1, Gift2, Gift3, Gift4, Gift5");
	        return 1;
	    }
		if(!strcmp(type, "gift1", true))
		{
			Gift1 =1;
   			new GiftBox1 = CreateDynamicObject(19054, x, y, z, 0.00000, 0.00000, 0.00000, 0, 0, -1, 200.0);
		    IsValidDynamicObject(GiftBox1);
		    return 1;
		}
		if(!strcmp(type, "gift2", true))
		{
		    Gift2 =1;
		    new GiftBox2 = CreateDynamicObject(19055, x, y, z, 0.00000, 0.00000, 0.00000, 0, 0, -1, 200.0);
		    IsValidDynamicObject(GiftBox2);
		    return 1;
		}
		if(!strcmp(type, "gift3", true))
		{
			Gift3 =1;
   			new GiftBox3 = CreateDynamicObject(19056, x, y, z, 0.00000, 0.00000, 0.00000, 0, 0, -1, 200.0);
		    IsValidDynamicObject(GiftBox3);
		    return 1;
		}
		if(!strcmp(type, "gift4", true))
		{
            Gift4 =1;
  			new GiftBox4 = CreateDynamicObject(19057, x, y, z, 0.00000, 0.00000, 0.00000, 0, 0, -1, 200.0);
		    IsValidDynamicObject(GiftBox4);
		    return 1;
		}
		if(!strcmp(type, "gift5", true))
		{
		    Gift5 =1;
		    new GiftBox5 = CreateDynamicObject(19058, x, y, z, 0.00000, 0.00000, 0.00000, 0, 0, -1, 200.0);
		    IsValidDynamicObject(GiftBox5);
		    return 1;
		}
        return 1;
    }
    else if(!strcmp(option, "remove", true))
    {
		// Code...
        return 1;
    }
    return 1;
}
also is there a way I could add text on the present when it is created? like /open in blue text? like a 3dtext thing
Reply


Messages In This Thread
Present system - by JacobSanchez - 15.12.2013, 16:40
Re: Present system - by JacobSanchez - 15.12.2013, 23:21
Re: Present system - by Vince - 15.12.2013, 23:41
Re: Present system - by JacobSanchez - 15.12.2013, 23:45
Re: Present system - by JacobSanchez - 16.12.2013, 22:11
Re: Present system - by Vince - 16.12.2013, 22:55
Re: Present system - by Dokins - 16.12.2013, 23:21
Re: Present system - by JacobSanchez - 16.12.2013, 23:38
Re: Present system - by JacobSanchez - 16.12.2013, 23:50
Re: Present system - by Dokins - 17.12.2013, 00:03

Forum Jump:


Users browsing this thread: 2 Guest(s)