[Ajuda] Comando Aparecer Obj
#3

Comandos para criar ou destruir um objeto que apenas o player que o criou tem o controle sobre ele:

No inнcio do GM:
Код:
new bool:criadod[MAX_PLAYERS][20]; //20 Objetos por player
new objetoid[MAX_PLAYERS][20];
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/aponte", cmdtext, true))
	{
		if(criadod[playerid][0])
	    	{
	    	SendClientMessage(playerid, cor, "ERRO: Esta ponte jб foi criada por vocк!");
		return 1;
	    	}
		objetoid[playerid][0] = CreateObject(1464, 1478.1805, -1736.6083, 13.3828, 0.0, 0.0 ,0.0, 300);
		SendClientMessage(playerid, cor, "Ponte criada com sucesso!");
		criadod[playerid][0] = true;
		return 1;
 	}
 	
	if(!strcmp("/dponte", cmdtext, true))
	{
		if(!criadod[playerid][0])
	    	{
	    	SendClientMessage(playerid, cor, "ERRO: Esta ponte jб foi destruida por vocк!");
		return 1;
	    	}
		DestroyObject(objetoid[playerid][0]);
                SendClientMessage(playerid, cor, "Ponte destruнda com sucesso!");
		criadod[playerid][0] = false;
		return 1;
	}
}
Comandos para criar ou destruir um objeto que todos tem o controle:

No inнcio do GM:
Код:
new objetoid[100];   //100 Objetos
new bool:criadod[100];
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp("/aponte", cmdtext, true))
	{
		if(criadod[0])
	    	{
	    	SendClientMessage(playerid, cor, "ERRO: Esta ponte jб foi criada!");
		return 1;
	    	}
		objetoid[0] = CreateObject(1464, 1478.1805, -1736.6083, 13.3828, 0.0, 0.0 ,0.0, 300);
		SendClientMessage(playerid, cor, "Ponte criada com sucesso!");
		criadod[0] = true;
		return 1;
 	}

	if(!strcmp("/dponte", cmdtext, true))
	{
		if(!criadod[0])
	    	{
	    	SendClientMessage(playerid, cor, "ERRO: Esta ponte jб foi destruida!");
		return 1;
	    	}
		DestroyObject(objetoid[0]);
                SendClientMessage(playerid, cor, "Ponte destruнda com sucesso!");
		criadod[0] = false;
		return 1;
	}
}
Reply


Messages In This Thread
Comando Aparecer Obj - by VictorMM - 09.08.2017, 23:41
Re: Comando Aparecer Obj - by UserUnk0wn - 10.08.2017, 00:49
Re: Comando Aparecer Obj - by Fakeger2 - 12.08.2017, 02:34

Forum Jump:


Users browsing this thread: 1 Guest(s)