15.12.2013, 16:40
I got the command but when I type /gift crate [then gift type] the present is not created, any idea
?
Code:
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
?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;
}


