SA-MP Forums Archive
how to create a message when im enter a command - 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: how to create a message when im enter a command (/showthread.php?tid=134926)



how to create a message when im enter a command - RobShakur - 18.03.2010

hay dudes
im sorry
but i dont can create /moneypickup and the must i say where the moneypickup is in which country can you script a part (DOWN ON THE COMMAND)
example: /moneypickup near los santos /ls (example !)
Код:
#include <a_samp>

#pragma tabsize 0

new mypickup;

main()
{
    print("**********************************");
    print("*********[R]Zees moneypickup******");
    print("*******Script created by [R]Zee***");
    print("**********************************");
}

public OnGameModeInit()
{
    print("**********************************");
    print("*********[R]Zees moneypickup******");
    print("*******Script created by [R]Zee***");
    print("**********************************");

return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == mypickup )
	  {
    GivePlayerMoney(playerid, 100000);
    DestroyPickup(mypickup);
    new fname[256],playername[256],string[256];
	  GetPlayerName(playerid, playername, sizeof(playername));
	  format(string, sizeof(string), "%s hat das MoneyPickup gefunden Inhalt: 100.000$", playername);
	  SendClientMessageToAll(0xFFFF00AA, string);
 	  format(fname,sizeof(fname),(playername));
    }
    return 1;
}
    
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/moneypickup", true)) {
    new Float:x, Float:y, Float:z;
    new whattheplayerenter;
    GetPlayerPos(playerid, x, y, z);
    SendClientMessageToAll(0xFFFF00AA, whattheplayerenter);
    GetPlayerKeys(playerid,whattheplayerenter);
    mypickup= CreatePickup(1274, 23, x, y, z);
    return 1;
    }
    return 0;
}