12.02.2018, 15:12
Ontem pedi um sistema de casas, eu criei um sistema para vocкs. Para vocкs comeзarem a estudar e fazer.
Vou comeзar fazer agora meu sistema, TMJ <3
Vou comeзar fazer agora meu sistema, TMJ <3
PHP код:
#include <a_samp>
#include <DOF2>
#include <zcmd>
#define MAX_CASAS 200
#define COR_BRANCO 0xFFFFFFFF
new gstring[150];
#pragma tabsize 0
enum Casa{
Dono[MAX_PLAYER_NAME+1],
Numero,
Float:pickupx,
Float:pickupy,
Float:pickupz
}
new Info_Casa[MAX_CASAS][Casa],
Texto[80]
;
public OnFilterScriptInit()
{
CriarCasa(100, 2051.6018,850.5718,6.7267);
return 1;
}
public OnFilterScriptExit()
{
DOF2_Exit();
return 1;
}
static CriarCasa(casaid, Float:PickupX, Float:PickupY, Float:PickupZ)
{
format(gstring, 150, "/Casas/ID%i.ini", casaid);
if(!DOF2_FileExists(gstring)){
DOF2_CreateFile(gstring);
Info_Casa[casaid][Numero] = casaid;
Info_Casa[casaid][pickupx] = PickupX;
Info_Casa[casaid][pickupy] = PickupY;
Info_Casa[casaid][pickupz] = PickupZ;
DOF2_SetInt(gstring, "Casa_Numero_Id", casaid);
DOF2_SetFloat(gstring, "Pickup_X", PickupX);
DOF2_SetFloat(gstring, "Pickup_Y", PickupY);
DOF2_SetFloat(gstring, "Pickup_Z", PickupZ);
DOF2_SaveFile();
}else{
DOF2_SetFloat(gstring, "Pickup_X", PickupX);
DOF2_SetFloat(gstring, "Pickup_Y", PickupY);
DOF2_SetFloat(gstring, "Pickup_Z", PickupZ);
}
Info_Casa[casaid][pickupx] = PickupX;
Info_Casa[casaid][pickupy] = PickupY;
Info_Casa[casaid][pickupz] = PickupZ;
format(Texto, 80, "Casa Nъmero %i", Info_Casa[casaid][Numero]);
Create3DTextLabel(Texto, COR_BRANCO, PickupX, PickupY, PickupZ, 70.0, 0, 0);
CreatePickup(1273, 23, PickupX, PickupY, PickupZ);
}
CMD:ircasa(playerid, params[]){
SetPlayerPos(playerid, 2051.6018,850.5718,6.7267);
return 1;
}