SA-MP Forums Archive
Help with createhouse 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: Help with createhouse command.. (/showthread.php?tid=306177)



Help with createhouse command.. - Azzeto - 25.12.2011

Hey, so I started a house system, (very basic) so I have /createhouse(exterior/interior) and I get warnings with the

Float:Position[3](x,y,z);

COMMAND:
pawn Код:
CMD:createhouse(playerid,params[])
{
    for(new i; i < MAX_HOUSES; i++)
    {
        if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You're not authorized to use this command");
        if(strcmp(params,"exterior",false)==0)
        {
            new Float:Position[3];
            GetPlayerPos(playerid,Position[0],Position[1],Position[2]);
            HouseInfo[i][ExteriorX] = Position[0];
            HouseInfo[i][ExteriorY] = Position[1];
            HouseInfo[i][ExteriorZ] = Position[2];
            SendClientMessage(playerid,ORANGE,"House Exterior Set [/createhouse interior]");
        }
        if(strcmp(params,"interior",false)==0)
        {
            new Float:Position[3];
            GetPlayerPos(playerid,Position[0],Position[1],Position[2]);
            HouseInfo[i][InteriorX] = Position[0];
            HouseInfo[i][InteriorY] = Position[1];
            HouseInfo[i][InteriorZ] = Position[2];
            SendClientMessage(playerid,ORANGE,"House Interior Set.");
        }
    }
    return 1;
}
WARNINGS
Код:
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1121) : warning 213: tag mismatch
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1122) : warning 213: tag mismatch
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1123) : warning 213: tag mismatch
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1130) : warning 213: tag mismatch
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1131) : warning 213: tag mismatch
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1132) : warning 213: tag mismatch
C:\Documents and Settings\Customer\Desktop\Fort Carson Roleplay\gamemodes\gamemode.pwn(1224) : warning 203: symbol is never used: "time"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


7 Warnings.
IGNORE THE LAST WARNING


Re: Help with createhouse command.. - FireCat - 25.12.2011

In your enum, where ExteriorX,Y and Z, put "Float:" behind of them.
And you command fixed:
pawn Код:
CMD:createhouse(playerid,params[])
{
    for(new i; i < MAX_HOUSES; i++)
    {
        if(PlayerInfo[playerid][Adminlevel] < 4) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You're not authorized to use this command");
        if(strcmp(params,"exterior",false)==0)
        {
            GetPlayerPos(playerid,HouseInfo[i][ExteriorX],HouseInfo[i][ExteriorY],HouseInfo[i][ExteriorZ]);
            SendClientMessage(playerid,ORANGE,"House Exterior Set [/createhouse interior]");
        }
        if(strcmp(params,"interior",false)==0)
        {
            GetPlayerPos(playerid,HouseInfo[i][InteriorX],HouseInfo[i][InteriorY],HouseInfo[i][InteriorZ]);
            SendClientMessage(playerid,ORANGE,"House Interior Set.");
        }
    }
    return 1;
}



Re: Help with createhouse command.. - suhrab_mujeeb - 25.12.2011

EDIT: nvm, firecat was too fast on that one.


Re: Help with createhouse command.. - Azzeto - 25.12.2011

Thanks with that, I feel so silly :P repped firecat