I dont get it! Please help! :/
#1

how's it possible that when i do

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    new weapons[13][2];
    for (new i = 0; i < 13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
    }
        return 1;
}
and
pawn Код:
public OnPlayerSpawn(playerid)
{
    new weapons[13][2];
    for (new i = 0; i < 13; i++)
    GivePlayerWeapon(playerid, weapons[i][0], weapons[i][1]);
    return 1;
}
After spawn i dont get the weapons even the code is correct(atleast looks corect to me :P),
now i know that weapons get reset after death so it might be that, but how to hell could be
created scripts like mabakos or garciats weapon drop scripts i mean its basicly the same damn
thing about saving and giving weapons!
Reply
#2

i dont get u xD so u want make a drop weapon script?
Reply
#3

The variable called "weapons" is local, it only exists inside the functions you create it in. This should work:
The reason I added OnPlayerConnect is so players won't get weapons from previous players.
pawn Код:
new weapon[ MAX_PLAYERS ][ 13 ];
new ammo[ MAX_PLAYERS ][ 13 ];

public OnPlayerConnect( playerid )
{
    for (new i = 0; i < 13; i++)
    {
        weapon[playerid][i] = 0;
        ammo[playerid][i] = 0;
    }
}

public OnPlayerDeath(playerid, killerid, reason)
{
   
    for (new i = 0; i < 13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapon[playerid][i], ammo[playerid][i]);
    }
   
    return 1;
}

public OnPlayerSpawn(playerid)
{
    for (new i = 0; i < 13; i++)
    GivePlayerWeapon(playerid, weapon[playerid][i], ammo[playerid][i]);
    return 1;
}
Reply
#4

Oh dude! thank you so much g_aSlice Nr.1! and btv hows it going with that "Aranha Mod" ^^
i hope that Kye is watching your work ^^ maybe in next versions of sa-mp we gonna see your
name in the credits....
Thanks alot!
Reply
#5

Quote:
Originally Posted by OldDirtyBastard
Посмотреть сообщение
Oh dude! thank you so much g_aSlice Nr.1! and btv hows it going with that "Aranha Mod" ^^
i hope that Kye is watching your work ^^ maybe in next versions of sa-mp we gonna see your
name in the credits....
Thanks alot!
No problem.
Also, I stopped developing it cause I can't do it all by myself and I couldn't find anyone willing to help out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)