SA-MP Forums Archive
Little help, startoff weapons... - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Little help, startoff weapons... (/showthread.php?tid=186309)



Little help, startoff weapons... - OldDirtyBastard - 28.10.2010

Hello sa-mp comunity, the thing is that i wanted to give the players for start off
some weapons, but only for the start, means that when they die, they wont have them anymore,
i tried to put GivePlayerWeapon function it under the OnPlayerConnect callback but it didnt worked,
when i was testing it, i didnt recieved any weapons...
Anyone could give me some other idea how can i make it?
thanks regards.


Re: Little help, startoff weapons... - DeathOnaStick - 28.10.2010

Quote:
Originally Posted by OldDirtyBastard
Посмотреть сообщение
Hello sa-mp comunity, the thing is that i wanted to give the players for start off
some weapons, but only for the start, means that when they die, they wont have them anymore,
i tried to put GivePlayerWeapon function it under the OnPlayerConnect callback but it didnt worked,
when i was testing it, i didnt recieved any weapons...
Anyone could give me some other idea how can i make it?
thanks regards.
Use SetSpawnInfo under OnPlayerConnect (with weapons) and under OnPlayerDeath (without weapons). Then it should work, I guess.


Re: Little help, startoff weapons... - OldDirtyBastard - 28.10.2010

nah still nothing :/ i have it in this format, might correct me if theres some mistake:
pawn Код:
public OnPlayerConnect(playerid)
{
    for (new i = 0; i < 300; i++)
{
    if (IsValidSkin(i))
    {
    SetSpawnInfo( playerid, 0, i, 1958.33, 1343.12, 15.36, 269.15, 27, 28, 30, 90, 0, 0 );
    }
}
    return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    for (new i = 0; i < 300; i++)
{
    if (IsValidSkin(i))
    {
    SetSpawnInfo( playerid, 0, i, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
    }
}
    return 1;
}



Re: Little help, startoff weapons... - DeathOnaStick - 28.10.2010

Quote:
Originally Posted by OldDirtyBastard
Посмотреть сообщение
nah still nothing :/ i have it in this format, might correct me if theres some mistake:
pawn Код:
public OnPlayerConnect(playerid)
{
    for (new i = 0; i < 300; i++)
{
    if (IsValidSkin(i))
    {
    SetSpawnInfo( playerid, 0, i, 1958.33, 1343.12, 15.36, 269.15, 27, 28, 30, 90, 0, 0 );
    }
}
    return 1;
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    for (new i = 0; i < 300; i++)
{
    if (IsValidSkin(i))
    {
    SetSpawnInfo( playerid, 0, i, 1958.33, 1343.12, 15.36, 269.15, 0, 0, 0, 0, 0, 0 );
    }
}
    return 1;
}
Seems incorrect. Try this:

pawn Код:
public OnPlayerConnect(playerid)
{
    SetSpawnInfo( playerid, 0, GetPlayerSkin(playerid), 1958.33, 1343.12, 15.36, 269.15, 27, 28, 30, 90, 0, 0 );
    return 1;
}
pawn Код:
public OnPlayerConnect(playerid)
{
    SetSpawnInfo( playerid, 0, GetPlayerSkin(playerid), 1958.33, 1343.12, 15.36, 269.15, 27, 28, 30, 90, 0, 0 );
    return 1;
}



Re: Little help, startoff weapons... - OldDirtyBastard - 28.10.2010

well, that didint worked aswell, but i solved the problem when I've puted the SetSpawnInfo function under
the OnPlayerReqestClass callback and then it worked i spawned with weapons, when i killed myself i respawned
without them, so thanks DeathOnaStick , but the thing is that i get kinda pain in the ass cuz it might can get abused,
the point was to force the player to earn something, i gues thats my next suggestion for future sa-mp versions,
make SetSpawnInfo/GivePlayerWeapon functions work at OnPlayerConnect lol