pickup test horseshoe - 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)
+--- Thread: pickup test horseshoe (
/showthread.php?tid=658288)
pickup test horseshoe -
Mobtiesgangsa - 31.08.2018
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:41] filterscripts = "" (string)
[10:57:41]
[10:57:41] Server Plugins
[10:57:41] --------------
[10:57:41] Loading plugin: sscanf
[10:57:41]
[10:57:41] ===============================
[10:57:41] sscanf plugin loaded.
[10:57:41] Version: 2.8.2
[10:57:41] (c) 2012 Alex "******" Cole
[10:57:41] ===============================
[10:57:41] Loaded.
[10:57:41] Loading plugin: Whirlpool
[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 plugin: mapandreas
[10:57:41] Loaded.
[10:57:41] Loaded 3 plugins.
[10:57:41]
[10:57:41] Filterscripts
[10:57:41] ---------------
[10:57:41] Loaded 0 filterscripts.
[10:57:41] AMX (31762576) loaded
[10:57:41] Number of vehicle models: 1
[10:58:06] [connection] incoming connection: 127.0.0.1:54350 id: 0
[10:58:06] [join] Player has joined the server (0:127.0.0.1)
[10:58:31] RCON (In-Game): Player #0 (Player) has logged in.
[10:58:37] RCON (In-Game): Player [Player] sent command: gmx
[10:58:49] AMX (31762576) loaded
[10:58:49] Number of vehicle models: 1
[10:58:55] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (629) Limit: 500/sec
[10:58:55] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (629) Limit: 500/sec
[10:59:01] RCON (In-Game): Player [Player] sent command: gmx
[10:59:13] AMX (31762576) loaded
[10:59:13] Number of vehicle models: 1
[10:59:18] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:18] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:18] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:18] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:19] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:52] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[10:59:53] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:27] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:28] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:28] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:28] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:28] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:00:28] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:02] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (645) Limit: 500/sec
[11:01:49] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:49] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:49] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:49] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:49] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:50] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:50] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:50] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:50] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:50] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:01:50] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (638) Limit: 500/sec
[11:02:28] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (631) Limit: 500/sec
[11:02:29] [warning] client exceeded 'messageslimit' 127.0.0.1:54350 (631) Limit: 500/sec
[11:04:12] [part] Player has left the server (0:1)
Re: pickup test horseshoe -
Shinja - 31.08.2018
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 i; i < MAX_PLAYERS; ++i)
{
HorseShoe[i] = CreateDynamicPickup(954, 2, 985.0377, 2562.6399, 11.0507, 0, 0, i);
}
Also you need to destroy the pickup after its picked