#1

im creating a pvp script, when player types /pvp [playerid] [weapon id] [weapon id] he gets teleported to the pvp zone and giving those weapons, who typed in...

pawn Код:
new
    bool:InvitedDuel[MAX_PLAYERS],
    IdDuel[MAX_PLAYERS],
    w1[MAX_PLAYERS],
    w2[MAX_PLAYERS],
    bool:UsingArena,
    Counting = 5,
    CountDueling[5][5] ={"~r~1","~b~2","~p~3","~y~4","~g~5"}
;
pawn Код:
dcmd_duel(playerid, params[])
{
    new id,w1,w2,string[128];
    new Index;
    new tmp[256], tmp2[256], tmp3[256];
    tmp = strtok(params, Index);
    tmp2 = strtok(params, Index);
    tmp3 = strtok(params, Index);
       
    id = strval(tmp);
    w1 = strval(tmp2);
    w2 = strval(tmp3);
       
    if(InvitedDuel[playerid] == true)
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Have you invited someone, wait Expire Invitation");

    if(UsingArena == true)
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : At the time the Arena is Being Used");

    if(!IsValidWeapon(w1) || !IsValidWeapon(w2))
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Use Valids Weapons IDs");
           
    if(!strlen(tmp2) || !strlen(tmp3))
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Use /duel [id] [wep1] [wep2]");
           
    if(!strlen(tmp))
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : You must enter the ID of the player following the Way (/duel [playerid])");

    if(id == playerid)
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : You can not invite the Self");

    if(InvitedDuel[id] == true)
        return SendClientMessage(playerid,0xF41917AA,"»»[DUEL]«« : Currently the player is in a Duel, wait..");
           
    new name[24];
    GetPlayerName(playerid, name, sizeof(name));
    format(string, sizeof(string), "»»[DUEL]«« : %s This inviting you to a \n Duel Runing (Press Accept to Accept Duel)",name);
    ShowPlayerDialog(id,DIALOG_DUEL,DIALOG_STYLE_MSGBOX,"»»[DUEL]«« :",string,"Accept", "No");
    GameTextForPlayer(id,"~r~DUE~w~LO !", 2500, 3);
    IdDuel[id] = playerid;
    wep1[id] = w1;
    wep2[id] = w2;
    SetTimerEx("ExpireDuel",15000,false,"ii",id,playerid);
    return true;
}

and there shows to next player a dialog,

pawn Код:
if(dialogid == DIALOG_DUEL)
    {
        if(!response) return ExpireDuel(playerid,IdDuel[playerid]);
        if(response)
        {
            UsingArena = true;
            new name[MAX_PLAYER_NAME], string[44];
            GetPlayerName(playerid, name, sizeof(name));
            format(string, sizeof(string), "»»[DUEL]«« : %s accepted the challenge, wait 8 seconds to go to Duel.",name);
            SendClientMessage(IdDuel[playerid],0xF6F600AA,string);
            SendClientMessage(playerid,0xF6F600AA,"»»[DUEL]«« : You accepted the Duel Wait 8 seconds to process your Data");
            SetTimerEx("GoDuel",8000,false,"ii",playerid,IdDuel[playerid],wep1[playerid],wep2[playerid]);
        }
        return true;
    }
activates timers and other...


now going here :


pawn Код:
forward GoDuel(playerid,pid,w1,w2);
public GoDuel(playerid,pid,w1,w2)
{


    GivePlayerWeapon(playerid,w1,999999);
    GivePlayerWeapon(playerid,w2,999999);
    GivePlayerWeapon(pid,w1,999999);
    GivePlayerWeapon(pid,w2,999999);
    TogglePlayerControllable(playerid,false);
    TogglePlayerControllable(pid,false);
    return true;
}

but when the timer start i dont get those stupid guns, where is the problem??

in dcmd_pvp everything is ok, but in goduel, i dont get those weapons, i tryed to get those weapons when i type just /pvp - everythings working, but in stupid timer no... omg i tryed everything
Reply
#2

Are these arrays global?

pawn Код:
new ids,w1,w2,string[128];
Reply
#3

i added pvp command now, look somebody please
Reply
#4

no replies -.-, any suggestions how to change weapon system
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)