Help with /createvent
#1

Hi, /createvent works perfectly except...The first weapon(Second works fine).

pawn Код:
new Float:eX, Float:eY, Float:eZ, eGun, eGun1, eSkin, Event; //Obviously got this on top
pawn Код:
cmd(createvent, playerid, params[])
{
    if(PlayerInfo[playerid][pAdmin] < 2) return SCM(playerid, GREY, "You are not authorized to use this command");
    if(Event == 1 || Event == 2) SCM(playerid, GREY, "Event already started");
    if(sscanf(params, "uii", eGun,eGun1, eSkin)) return SendClientMessage(playerid, GREY, "CMD:/createvent [Gun1] [Gun2] [Skin]");
    GetPlayerPos(playerid, eX, eY, eZ);
    GivePlayerWeapon(playerid, 38, 99999);
    SendClientMessageToAll(GREEN, "Warning:An event has been opened, to join write /joinevent.");
    SendClientMessageToAll(GREEN, "After the event you will spawn where you were, with all your weapons");
    Event = 1;
    return 1;
}
pawn Код:
cmd(joinevent, playerid, params[])
{
    if(InEvent[playerid] == 1) return SCM(playerid, GREY, "You are already in the event!");
    if(Event == 0) return SCM(playerid, GREY, "There is no event going on!");
    if(Event == 2) return SCM(playerid, GREY, "Event is locked!");
    UpdateStats(playerid);
    SetSpawnInfo(playerid, 0, eSkin, eX, eY, eZ, 269.15, eGun, 99999, eGun1, 99999, 0, 0);
    SpawnPlayer(playerid);
    InEvent[playerid] = 1;
    return 1;
}
What I mean by the first weapon not working is, it always sets it to 1, making ti brass knuckles.
Reply
#2

Well its in your sscanf

pawn Код:
* * if(sscanf(params, "iii", eGun,eGun1, eSkin)) return SendClientMessage(playerid, GREY, "CMD:/createvent [Gun1] [Gun2] [Skin]");
U is for userid/name.
i is for number

Sorry about format on my ipod....
Reply
#3

Thank you very much! Repped.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)