SendClientMessageToAll
#1

how can i make when player pickup pickup then send message to all Nick wa picked up a pickup in pickup was cash
Reply
#2

Use OnPlayerPickUpPickup(playerid,pickupid)
Reply
#3

Use this:

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickup == pickup){ // when the player pickup pickup
    GivePlayerMoney(playerid, cash); // Giving player cash
    new string[256];
    new name[128];
    GetPlayerName(playerid,name,128);
    format(string, sizeof(string), "%s is ...",name); the "..." change you..
   }
    return 1;
}
Reply
#4

if(pickup == pickup){ // when the player pickup pickup
theese line give me a 4 errors
Reply
#5

You must
Код:
new pickup;
adding per mode.
And this in OnGameModeInıt:
pickup = CreatePickup(...);

by me give not errors.


( sorry for my very bad english. )
Reply
#6

Quote:
Originally Posted by _TeRmiNaToR_
You must
Код:
new pickup;
adding per mode.
And this in OnGameModeInıt:
pickup = CreatePickup(...);

by me give not errors.


( sorry for my very bad english. )
And why in OnGameModeInit?
Reply
#7

nothing
Код:
C:\Documents and Settings\Martins\Desktop\fizzypasakums.pwn(203) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Martins\Desktop\fizzypasakums.pwn(203) : warning 215: expression has no effect
C:\Documents and Settings\Martins\Desktop\fizzypasakums.pwn(203) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\Martins\Desktop\fizzypasakums.pwn(203) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Martins\Desktop\fizzypasakums.pwn(203) : fatal error 107: too many error messages on one line
there is my fs edit what is wrong:
Код:
#include <a_samp>

#define COLOR_WHITE
#define some
#define pickup



new pk1;
new pk2;
new pk3;
new pk4;
new pk5;
new pk6;
new pk7;
new pk8;
new pk9;
new pk10;
new pk11;
new pk12;
new pk13;
new pk14;
new pk15;
new pk16;

// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
pk1 = CreatePickup(-2084.3301,-216.8675,34.6121);
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

main()
{
	print("\n----------------------------------");
	print(" FiZzY Tuss");
	print("----------------------------------\n");
}

#endif

public OnGameModeInit()
{
  pk1 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk2 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk3 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk4 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk5 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk6 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk7 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk8 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk9 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk10 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk11 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk12 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk13 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk14 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk15 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);
  pk16 = CreatePickup(1239, 3, -2084.3301,-216.8675,34.6121);



	return 1;
}




public OnGameModeExit()
{
	return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
	SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
	SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
	return 1;
}

public OnPlayerRequestSpawn(playerid)
{
	return 1;
}

public OnPlayerConnect(playerid)
{
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	return 1;
}

public OnPlayerSpawn(playerid)
{
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
	return 1;
}

public OnVehicleSpawn(vehicleid)
{
	return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
	return 1;
}

public OnPlayerText(playerid, text[])
{
	return 1;
}

public OnPlayerPrivmsg(playerid, recieverid, text[])
{
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{

	return 0;
}

public OnPlayerInfoChange(playerid)
{
	return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
	return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
	return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
	return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
	return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
	return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
	return 1;
}

public OnRconCommand(cmd[])
{
	return 1;
}

public OnObjectMoved(objectid)
{
	return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{

 		if(pickup == pk1){ // when the player pickup pickup
    GivePlayerMoney(playerid, 10000); // Giving player cash
    new string[256];
		 new name[128];
		 GetPlayerName(playerid,name,128);
		 format(string, sizeof(string), "%s is ...",name);
    }
		return 1;

 		if(pickup == pk2){ // when the player pickup pickup
    GivePlayerMoney(playerid, cash); // Giving player cash
    new string[256];
		 new name[128];
		 GetPlayerName(playerid,name,128);
		 format(string, sizeof(string), "%s is ...",name);
    }
		return 1;


	if (pickupid == pk3) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk4) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk5) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk6) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk7) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk8) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk9) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk10) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk11) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk12) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk13) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk14) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk15) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	if (pickupid == pk16) // Check that the picked up pickup id is the same as the id of the one we created
	{
		// It is
 		new string[128];
	  new sendername[MAX_PLAYER_NAME];
		GetPlayerName(playerid, sendername, sizeof(sendername));
		format(string, sizeof(string), "%s Has Requested To Be Picked Up", sendername);
		SendClientMessageToAll(COLOR_WHITE, string);
		SendClientMessage(playerid, COLOR_WHITE, "Your Request To Be Picked Up Has Been Sent. Thank You.");
	}
	else if (pickupid == (some other pickup))
	{
		// Another pickup, do something else
	}
	return 1;
}

	return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
	return 1;
}

public OnPlayerExitedMenu(playerid)
{
	return 1;
}
Reply
#8

oh i repaired the error but when player pick up pickup dont send message to all
Reply
#9

Quote:
Originally Posted by Scoots
there is my fs edit what is wrong:
Well first, if you say its a filterscript, then why are you using OnGameModeInit. You should be using OnFilterscriptInit.
Reply
#10

I inser in Gm but when pickup pickup dont show messsage to all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)