CMD:criarcasa(playerid, params[])
{
new Level[60], dinheiro, string[155], Float:Pos[3];
if(sscanf(params, "uii", Level, dinheiro)) return SendClientMessage(playerid, -1, "Use /criarcasa [Nivel] [Preco] [Interior ID]");{
CreatePickup(1273, 0 , Pos[0], Pos[1], Pos[2], 0);
format(string, sizeof(string),"[INFO-CASA] \n Level : %d \n Preco : %d \n Interior %d",Level , dinheiro);
Create3DTextLabel(string, -1, Pos[0], Pos[1], Pos[2], 40.0, 0,0);
}
return 1;
}
CMD:criarcasa(playerid, params[])
{
new Level, dinheiro, interior;
if(sscanf(params, "iii", Level, dinheiro, interior)) return SendClientMessage(playerid, -1, "Use /criarcasa [Nivel] [Preco] [Interior ID]");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
CreatePickup(1273, 0 , Pos[0], Pos[1], Pos[2], 0);
new string[155];
format(string, sizeof(string),"[INFO-CASA] \n Level : %d \n Preco : %d \n Interior %d",Level , dinheiro, interior);
Create3DTextLabel(string, -1, Pos[0], Pos[1], Pos[2], 40.0, 0,0);
return 1;
}
CMD:criarcasa(playerid, params[])
{
new Level[60], dinheiro;
if(sscanf(params, "uii", Level, dinheiro))
return SendClientMessage(playerid, -1, "Use /criarcasa [Nivel] [Preco] [Interior ID]");
new string[155], Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
CreatePickup(1273, 0 , Pos[0], Pos[1], Pos[2], 0);
format(string, sizeof(string),"[INFO-CASA] \n Level : %d \n Preco : %d \n Interior %d",Level , dinheiro);
Create3DTextLabel(string, -1, Pos[0], Pos[1], Pos[2], 40.0, 0,0);
return 1;
}
|
PHP код:
|
|
vlw z pain e los
++rep como posso fazer assim Casa ID [0] Quando crio mais 1 Casa ID [1] E assim vai mals pelo caps ^-^ |
new nextHouseID = 0;
// ao criar a casa
nextHouseID++
new nextHouseID = 0; // TOPO DA GM
CMD:criarcasa(playerid, params[])
{
new Level, dinheiro, interior;
if(sscanf(params, "iii", Level, dinheiro, interior)) return SendClientMessage(playerid, -1, "Use /criarcasa [Nivel] [Preco] [Interior ID]");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
CreatePickup(1273, 0 , Pos[0], Pos[1], Pos[2], 0);
nextHouseID++
new string[155];
format(string, sizeof(string),"[CASA ID %d] \n Level : %d \n Preco : %d \n Interior %d" nextHouseID, Level , dinheiro, interior);
Create3DTextLabel(string, -1, Pos[0], Pos[1], Pos[2], 40.0, 0,0);
return 1;
}
new nextHouseID = 0; // TOPO DA GM
CMD:criarcasa(playerid, params[])
{
new Level, dinheiro, interior;
if(sscanf(params, "iii", Level, dinheiro, interior)) return SendClientMessage(playerid, -1, "Use /criarcasa [Nivel] [Preco] [Interior ID]");
new Float:Pos[3];
GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
CreatePickup(1273, 0 , Pos[0], Pos[1], Pos[2], 0);
new string[155];
format(string, sizeof(string),"[CASA ID %d] \n Level : %d \n Preco : %d \n Interior %d", nextHouseID, Level , dinheiro, interior);
Create3DTextLabel(string, -1, Pos[0], Pos[1], Pos[2], 40.0, 0,0);
nextHouseID++;
return 1;
}
|
Estгo sendo usados 3 especificadores para tratar 2 parвmetros, e o especificador "u" estб sendo usado para tratar "Level", que й uma string.
|