pickup test horseshoe
#1

Hello SA-MP Community i would like to share with you a Test Code i was writing
anyone has a solution to these problem that accrord

Код:
// Stored and loaded player data
enum e_PLAYERS
{
	e_HORSESHOE
}

// Player 2D array
new Player[MAX_PLAYERS][e_PLAYERS];

// Pickups collection
new HorseShoe[MAX_PLAYERS] = 0;


main()
{

}

public OnGameModeInit()
{
	for(new i; i < MAX_PLAYERS; ++i)
	{
	    HorseShoe[i] = CreatePickup(954, 2, 985.0377, 2562.6399, 11.0507, 0);
	}

	AddPlayerClass(0,992.6035,2558.0566,10.7513,58.5907,0,0,0,0,0,0); // myloc
	AddStaticVehicle(411,1001.3752,2572.5681,10.4639,57.6635,116,1); // infernus
	return 1;
}

public OnGameModeExit()
{
	return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
	if(HorseShoe[playerid] == pickupid)
	{
	    new string[128], pName[MAX_PLAYER_NAME];
	    GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
	    
	    Player[playerid][e_HORSESHOE]++;
	    
	    new targetid;
	    format(string, sizeof(string), "%s has collected a horseshoe", pName);
	    SendClientMessage(targetid, 0xF3EFFAA, string[0]);
	    
	    format(string, sizeof(string), "You just collected %d horseshoe", Player[playerid][e_HORSESHOE]);
	    SendClientMessage(playerid, 0xCAAF7FE, string[1]);
	}
	return 1;
}
Server Log prints:

PHP код:
----------
Loaded log file"server_log.txt".
----------
SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team
[10:57:41filterscripts ""  (string)
[
10:57:41
[
10:57:41Server Plugins
[10:57:41] --------------
[
10:57:41]  Loading pluginsscanf
[10:57:41
[
10:57:41]  ===============================
[
10:57:41]       sscanf plugin loaded.     
[
10:57:41]          Version:  2.8.2        
[10:57:41]    (c2012 Alex "******" Cole  
[10:57:41]  ===============================
[
10:57:41]   Loaded.
[
10:57:41]  Loading pluginWhirlpool
[10:57:41]  
[
10:57:41]  ==================
[
10:57:41]  
[
10:57:41]   Whirlpool loaded
[10:57:41]  
[
10:57:41]  ==================
[
10:57:41]  
[
10:57:41]   Loaded.
[
10:57:41]  Loading pluginmapandreas
[10:57:41]   Loaded.
[
10:57:41]  Loaded 3 plugins.
[
10:57:41
[
10:57:41Filterscripts
[10:57:41] ---------------
[
10:57:41]   Loaded 0 filterscripts.
[
10:57:41AMX (31762576loaded
[10:57:41Number of vehicle models1
[10:58:06] [connectionincoming connection127.0.0.1:54350 id0
[10:58:06] [joinPlayer has joined the server (0:127.0.0.1)
[
10:58:31RCON (In-Game): Player #0 (Player) has logged in.
[10:58:37RCON (In-Game): Player [Playersent commandgmx
[10:58:49AMX (31762576loaded
[10:58:49Number of vehicle models1
[10:58:55] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (629Limit500/sec
[10:58:55] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (629Limit500/sec
[10:59:01RCON (In-Game): Player [Playersent commandgmx
[10:59:13AMX (31762576loaded
[10:59:13Number of vehicle models1
[10:59:18] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:18] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:18] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:18] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:19] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:52] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[10:59:53] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:27] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:28] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:28] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:28] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:28] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:00:28] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:02] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (645Limit500/sec
[11:01:49] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:49] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:49] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:49] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:49] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:50] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:50] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:50] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:50] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:50] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:01:50] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (638Limit500/sec
[11:02:28] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (631Limit500/sec
[11:02:29] [warningclient exceeded 'messageslimit' 127.0.0.1:54350 (631Limit500/sec
[11:04:12] [partPlayer has left the server (0:1
Reply
#2

You are creating 1000 pickup in same location for all players
Use streamer so you can create 1 pickup for each player
Код:
CreateDynamicPickup(modelid, type, Float:x, Float:y, Float:z, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = 100.0);
PHP код:
for(new iMAX_PLAYERS; ++i)
    {
        
HorseShoe[i] = CreateDynamicPickup(9542985.03772562.639911.050700i);
    } 
Also you need to destroy the pickup after its picked
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)