New way o payout - 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: New way o payout (
/showthread.php?tid=251544)
New way o payout -
Panormitis - 27.04.2011
Hello world, here Is my Idea: I want to make a player for my server to get pay from a command, here is an excable, I have a command /lvtele ,when someone type this command, the player "Mathias" will take 200$ ( if he is online) , how make this? I have the command for the teleport, all I need is to make the player "Mathias" (excable) take money when someone type the command! Please help me with tha code! Thans!
Re: New way o payout -
Sinner - 27.04.2011
I assume you want this for any player that uses the command? Not just players with the name "Mathias", right?
Here:
PHP Code:
OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/lvtele", true)==0)
{
//Teleport the player
GivePlayerMoney(playerid, 200);
return 1;
}
return 0;
}
If not, here:
PHP Code:
OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/lvtele", true)==0)
{
//Teleport the player
new playername[24];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerName(i, playername, sizeof(playername));
if(strcmp(playername, "Mathias", true)==0)
{
GivePlayerMoney(i, 200);
}
}
}
return 1;
}
return 0;
}