SERVER: Unknown command - 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: SERVER: Unknown command (
/showthread.php?tid=606991)
SERVER: Unknown command -
wharlos - 13.05.2016
This is the second command that I'm creating as I had never created any command and CMD, hope not to bother and if they can help me since I have upset many friends.
I do not speak English and I'm using the ****** translator, a thousand apologies.
PHP код:
CMD:comprarcasa(playerid, params[])
{
new houseid = -1;
for(new i = 0; i < MAX_CASAS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]))
{
if(CasaInfo[houseid][cPropietario] != 0) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}Esta casa no estб en venta.");
if(CasaInfo[houseid][cPrecio] > PlayerInfo[playerid][Dinero]) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No tienes el dinero suficiente para adquirir estб casa.");
CasaInfo[i][cPropietario] = PlayerInfo[playerid][ID];
ActualizarCasas(houseid);
GuardarCasas(houseid);
GivePlayerMoney(playerid, -CasaInfo[i][cPrecio]);
SendClientMessageEx(playerid, COLOR_VERDE_1, "INFORMACIУN: {C7C7C7}Has adquirido una nueva casa por %s.", FormatoCantidad(CasaInfo[i][cPrecio]));
}
else return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No estбs cerca de una casa para utilizar el comando.");
}
return 1;
}
This happens when I create a second home, the error only happens with ID 1 House the other houses not
Re: SERVER: Unknown command -
KevinReinke - 13.05.2016
pawn Код:
CMD:comprarcasa(playerid, params[])
{
for(new i = 0; i < MAX_CASAS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, CasaInfo[i][cPosX], CasaInfo[i][cPosY], CasaInfo[i][cPosZ]))
{
if(CasaInfo[i][cPropietario] != 0) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}Esta casa no estб en venta.");
if(CasaInfo[i][cPrecio] > PlayerInfo[playerid][Dinero]) return SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No tienes el dinero suficiente para adquirir estб casa.");
CasaInfo[i][cPropietario] = PlayerInfo[playerid][ID];
ActualizarCasas(i);
GuardarCasas(i);
GivePlayerMoney(playerid, -CasaInfo[i][cPrecio]);
SendClientMessageEx(playerid, COLOR_VERDE_1, "INFORMACIУN: {C7C7C7}Has adquirido una nueva casa por %s.", FormatoCantidad(CasaInfo[i][cPrecio]));
return 1;
}
}
SendClientMessage(playerid, COLOR_ROJO, "ERROR: {C7C7C7}No estбs cerca de una casa para utilizar el comando.");
return 1;
}