Little help, startoff weapons...
#1

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.
Reply
#2

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.
Reply
#3

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;
}
Reply
#4

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;
}
Reply
#5

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)