SA-MP Forums Archive
/Setspawn - 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: /Setspawn (/showthread.php?tid=471218)



/Setspawn - .::: Ecko :::. - 21.10.2013

Код:
 
enum GangData
{
	Float:Spawnx,
	Float:Spawny,
	Float:Spawnz,
} 


CMD:setspawn(playerid, params[])
{

	if(!(IsPlayerAdmin(playerid))) return SendClientMessage(playerid, 0xFF0000AA, "You need to be RCON admin to use this command.");
	new gangid = PlayerInfo[playerid][GangID],string[256];
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);
    GangInfo[gangid][Spawnx] = x; GangInfo[gangid][Spawny] = y; GangInfo[gangid][Spawnz] = z;
    format(string, sizeof(string), "%s has change the spawn.",PlayerName(playerid));
    SendGangMessage(gangid,string,-1);
    DestroyPickup(gpickup[gangid]);
    gpickup[gangid] = CreatePickup(1314, 1, x,y,z, -1);

	return 1;
}

Why is it wrong it's just not spawning me at the position which was set.


Re: /Setspawn - -Prodigy- - 21.10.2013

That looks fine, can you show the code when you are spawned?


Re: /Setspawn - Akira297 - 21.10.2013

Make sure you also indent everything aswell..


Re: /Setspawn - .::: Ecko :::. - 22.10.2013

I made sure everything is here.

Well 'prodigy' you might be right.... I didn't include it code:

Код:
public OnPlayerSpawn(playerid)
{
	new file[256];
	format(file, sizeof(file), "Gangs/%d.ini",PlayerInfo[playerid][GangID]);
	new gangid = PlayerInfo[playerid][GangID];
	if(gangid > 0)
	{
		if(!(dini_Exists(file)) || strcmp(PlayerInfo[playerid][GangName], GangInfo[gangid][Name], false, strlen(PlayerInfo[playerid][GangName])))
		{
		    SendClientMessage(playerid, 0xFFFFFFFF , "The Gang has been abolished");
		    PlayerInfo[playerid][GangID] = 0;
		    PlayerInfo[playerid][GangRank] = 0;
		    strmid(PlayerInfo[playerid][GangName], " ", 0, strlen(" "), 255);
		}
		else
		{
		    GiveGangWeapon(playerid);
		}
		return 1;
	}
	return 1;
}
This is what I got under onplayerspawn.


Actually,
Код:
forward SaveGangs();
public SaveGangs()
{
	new file[256];
	for(new i=1;i<=MAX_GANGS;i++)
	{
	    format(file,sizeof(file), "Gangs/%i.ini",i);
	    if(dini_Exists(file))
	    {
	        dini_IntSet(file,"ID",GangInfo[i][ID]);
	        dini_Set(file,"Name", GangInfo[i][Name]);
	        dini_Set(file,"Leader", GangInfo[i][Leader]);
	        dini_FloatSet(file,"Spawnx",GangInfo[i][Spawnx]);
	        dini_FloatSet(file,"Spawny",GangInfo[i][Spawny]);
	        dini_FloatSet(file,"Spawnz",GangInfo[i][Spawnz]);
	        dini_IntSet(file,"Weapon1",GangInfo[i][Weapon1]);
	        dini_IntSet(file,"Weapon2",GangInfo[i][Weapon2]);
	        dini_IntSet(file,"Weapon3",GangInfo[i][Weapon3]);
	        dini_IntSet(file,"Weapon4",GangInfo[i][Weapon4]);
	        dini_IntSet(file,"Weapon5",GangInfo[i][Weapon5]);
	        dini_IntSet(file,"Weapon6",GangInfo[i][Weapon6]);
	        dini_Set(file,"Color",GangInfo[i][Color]);
	        dini_IntSet(file,"Interior",GangInfo[i][Interior]);
	        dini_IntSet(file,"Virtual",GangInfo[i][Virtual]);
	        dini_IntSet(file,"Day",GangInfo[i][Day]);
	        dini_IntSet(file,"Month",GangInfo[i][Month]);
	        dini_IntSet(file,"Year",GangInfo[i][Year]);
	        dini_IntSet(file,"Kills",GangInfo[i][Kills]);
	        dini_IntSet(file,"Deaths",GangInfo[i][Deaths]);
	        dini_IntSet(file,"Members",GangInfo[i][Members]);
	    }
	}
	return 1;
}

I just don't see why /setspawn is not working.


Re: /Setspawn - .::: Ecko :::. - 22.10.2013

Still not working I tried everything