SA-MP Forums Archive
help, i am newbie - 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: help, i am newbie (/showthread.php?tid=260065)



help, i am newbie - handerson - 07.06.2011

the is the prblem

how to make giveplayer money for new player, i mean the first money when they have registered


Re: help, i am newbie - Max_Coldheart - 07.06.2011

pawn Код:
public OnPlayerSpawn
{
    GivePlayerMoney(playerid, TheAmountOfMoney);
    return 1;
}



Re: help, i am newbie - 0ne - 07.06.2011

Lol the code is so wrong because it will give money everytime a player spawns, if you want to give money to player when hes playing first time you have to do such command when player registers.


Re: help, i am newbie - Namaco - 07.06.2011

pawn Код:
public OnPlayerRegister
{
    GivePlayerMoney(playerid, TheAmountOfMoney);
    return 1;
}
?


Re: help, i am newbie - Mean - 07.06.2011

Quote:
Originally Posted by Namaco
Посмотреть сообщение
pawn Код:
public OnPlayerRegister
{
    GivePlayerMoney(playerid, TheAmountOfMoney);
    return 1;
}
?
Dude, why do you post crap everywhere?

Anyway, to do this, put this in your register command:
pawn Код:
CMD:register( playerid, params[ ] ) {
    SetPVarInt( playerid, "FirstPlay", 1 );
    return 1;
}
And, OnPlayerSpawn
pawn Код:
public OnPlayerSpawn( playerid ) {
    if( GetPVarInt( playerid, "FirstPlay" ) == 1 ) {
        SendClientMessage( playerid, -1, "You received $1000 for your first play. " );
        GivePlayerMoney( playerid, 1000 );
    }
    return 1;
}



Re: help, i am newbie - handerson - 07.06.2011

Quote:
Originally Posted by Mean
Посмотреть сообщение
Dude, why do you post crap everywhere?

Anyway, to do this, put this in your register command:
pawn Код:
CMD:register( playerid, params[ ] ) {
    SetPVarInt( playerid, "FirstPlay", 1 );
    return 1;
}
And, OnPlayerSpawn
pawn Код:
public OnPlayerSpawn( playerid ) {
    if( GetPVarInt( playerid, "FirstPlay" ) == 1 ) {
        SendClientMessage( playerid, -1, "You received $1000 for your first play. " );
        GivePlayerMoney( playerid, 1000 );
    }
    return 1;
}
thanx man, u r great