SetEventInfo weird bug
#1

Hey guys, I am having a little issue with my event system
Every options except of "Position" simply returns nothing
For example:
Input: /seteventinfo health 100
Output: nothing

Here is the code
PHP код:
CMD:seteventinfo(playeridparams[])
{
    if(!
IsAllowed(playerid3)) return NoAuth(playerid);
    new 
option[10];
    if(
sscanf(params"s[10]"option))
    {
        
SendClientMessage(playeridCOLOR_WHITE"UASGE: /seteventinfo [option]");
        
SendClientMessage(playeridCOLOR_GREY"Available Options: Health || Armour || Weapon || Position || Text");
        return 
1;
    }
    if(!
strcmp(option"position"true))
    {
        
GetPlayerPos(playeridEventPos[0], EventPos[1], EventPos[2]);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have set the event spawn-point at your position.");
        return 
1;
    }
    if(!
strcmp(option"health"true))
    {
        new 
Float:hp;
        if(
sscanf(params"s[10]f"optionhp)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /seteventinfo health [amount]");
        
EventHealth hp;
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have set the new event health amount.");
        return 
1;
    }
    if(!
strcmp(option"armour"true))
    {
        new 
Float:ap;
        if(
sscanf(params"s[10]f"optionap)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /seteventinfo armour [amount]");
        
EventArmour ap;
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have set the new event armour amount.");
        return 
1;
    }
    if(!
strcmp(option"weapon"true))
    {
        new 
slotweaponidammo;
        if(
sscanf(params"s[10]iii"optionslotweaponidammo)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /seteventinfo weapon [slot] [weapon] [ammo]");
        if(
slot || slot 3) return SendClientMessage(playeridCOLOR_GREY"Slots are between 1 to 3.");
        if(
GetWeaponSlot(weaponid) == -1) return SendClientMessage(playeridCOLOR_WHITE"Invalid weapon ID.");
        if(
ammo 1) return SendClientMessage(playeridCOLOR_GREY"Ammo must be 1 or higher.");
        new 
string[128], weaponname[32];
        
EventWeapon[slot--] = weaponid;
        
EventAmmo[slot--] = ammo;
        
GetWeaponName(weaponidweaponnamesizeof(weaponname));
        
format(stringsizeof(string), "You have set the %d event weapon slot to %s with %d bullets."slotweaponnameammo);
        
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        return 
1;
    }
    if(!
strcmp(option"text"true))
    {
        new 
text[80];
        if(
sscanf(params"s[10]s[80]"optiontext)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /seteventinfo text [text]");
        
format(EventTextsizeof(EventText), "~r~%s"text);
        
SendClientMessage(playeridCOLOR_LIGHTBLUE"You have set the joining event game text.");
        return 
1;
    }
    return 
1;

Anyone ?
Reply


Messages In This Thread
SetEventInfo weird bug - by NeXoR - 18.11.2016, 09:08
Respuesta: SetEventInfo weird bug - by Swedky - 18.11.2016, 09:11
Re: Respuesta: SetEventInfo weird bug - by NeXoR - 18.11.2016, 09:25
Respuesta: SetEventInfo weird bug - by Swedky - 18.11.2016, 09:51
Re: Respuesta: SetEventInfo weird bug - by NeXoR - 18.11.2016, 18:20
Re: SetEventInfo weird bug - by NeXoR - 18.11.2016, 21:36

Forum Jump:


Users browsing this thread: 1 Guest(s)