SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 07/02/2020, 08:02 AM   #1
EAGLE
Little Clucker
 
Join Date: Nov 2019
Posts: 18
Reputation: 0
Default Error data store (array)

Hi, the all data are not saving in my array , idk why
code:

Code:
enum Dead_informations
{
	DeadSKIN,
	Float:DeadX,
	Float:DeadY,
	Float:DeadZ,
	DeadVIRTUALWORLD,
	DeadINTERIOR,
};
new DeadInfo[MAX_PLAYERS][Dead_informations];




public OnPlayerDeath(playerid, killerid, reason)
{
	new Float:x, Float:y, Float:z;
	new Player_interior = GetPlayerInterior(playerid);
	new Player_virtualworld = GetPlayerVirtualWorld(playerid);
	new Player_skin = GetPlayerSkin(playerid);
	
	if(Player_spawn_status[playerid] == SPAWN_TYPE_GLOBAL)
	{
		DeadInfo[playerid][DeadSKIN] = Player_skin;
		DeadInfo[playerid][DeadX] = x;
		DeadInfo[playerid][DeadY] = y;
		DeadInfo[playerid][DeadZ] = z;
		DeadInfo[playerid][DeadVIRTUALWORLD] = Player_virtualworld;
		DeadInfo[playerid][DeadINTERIOR] = Player_interior;

		new str[144];
		format(str, sizeof(str), "%f , %f , %f", DeadInfo[playerid][DeadX], DeadInfo[playerid][DeadY], DeadInfo[playerid][DeadZ]);
		SendClientMessage(playerid, -1, str);
		
        SendClientMessage(playerid, -1, "PLAYERDEATH > GLOBAL vers KO");
		Player_spawn_status[playerid] = SPAWN_TYPE_KO;
	}
	else if(Player_spawn_status[playerid] == SPAWN_TYPE_KO)
	{
		DeadInfo[playerid][DeadSKIN] = Player_skin;
		DeadInfo[playerid][DeadX] = x;
		DeadInfo[playerid][DeadY] = y;
		DeadInfo[playerid][DeadZ] = z;
		DeadInfo[playerid][DeadVIRTUALWORLD] = Player_virtualworld;
		DeadInfo[playerid][DeadINTERIOR] = Player_interior;

		new str[144];
		format(str, sizeof(str), "%f , %f , %f", DeadInfo[playerid][DeadX], DeadInfo[playerid][DeadY], DeadInfo[playerid][DeadZ]);
		SendClientMessage(playerid, -1, str);
			
	    SendClientMessage(playerid, -1, "PLAYERDEATH > KO vers DEAD");
	    Player_spawn_status[playerid] = SPAWN_TYPE_DEAD;
	}
	else if(Player_spawn_status[playerid] == SPAWN_TYPE_DEAD)
	{
	    SendClientMessage(playerid, -1, "PLAYERDEATH > DEAD vers HOPITAL");
	    Player_spawn_status[playerid] = SPAWN_TYPE_HOPITAL;
	}
	
	//SetTimerEx("Player_timer_respawn", 5000, false, "i", playerid);

	return true;
}
EAGLE is offline   Reply With Quote
Old 07/02/2020, 09:45 AM   #2
IZenta
Little Clucker
 
Join Date: Jan 2020
Location: Indonesia
Posts: 42
Reputation: 16
Default Re: Error data store (array)

You are only make new float x, y, z -_
Use this to get player pos:
pawn Code:
GetPlayerPos(playerid, x, y, z);
__________________
Discord: ZTzTopia#0001
IZenta is offline   Reply With Quote
Old 07/02/2020, 10:59 AM   #3
wilking
Little Clucker
 
Join Date: May 2017
Posts: 30
Reputation: 0
Default Re: Error data store (array)

Code:
GetPlayerPos(playerid,DeadInfo[playerid][DeadX],DeadInfo[playerid][DeadY],DeadInfo[playerid][Deadz]);
DeadInfo[playerid][DeadVIRTUALWORLD] = Player_virtualworld;
DeadInfo[playerid][DeadINTERIOR] = Player_interior;
DeadInfo[playerid][DeadSKIN] = Player_skin;
wilking is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What would be the best way to store data [mysql] PizzaPuntjes Scripting Help 8 02/08/2015 12:32 PM
MySQL store data bruxo00 Scripting Help 1 07/01/2015 08:32 PM
Store a data value thimo Scripting Help 4 10/05/2012 11:14 AM
Store an IP. Error: Must be assigned to an array Biesmen Help Archive 3 22/01/2011 03:58 PM
How to Store a Basic Data. Matthew_Johnston Help Archive 12 11/12/2010 03:24 AM


All times are GMT. The time now is 03:50 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.