Hallo
ja ich habe bei einen gf rellaife edit versucht die funktion /chouse zu erstellen aber irgendwie wenn ich das korekt eingebe unknowcommand kommt
if(strcmp(cmd, "/chouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, playername, sizeof(playername));
if(!strlen(strget(cmdtext,1)) || !strlen(strget(cmdtext,2)) || !strlen(strget(cmdtext,3)))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /chouse [Type1-12] [Kosten] [Level]");
return 1;
}
new HausType;
new money;
new level = strval(strget(cmdtext,3));
HausType = strval(strget(cmdtext,1));
money = strval(strget(cmdtext,2));
if (PlayerInfo[playerid][pAdmin] >= 2000)
{
GetPlayerPos(playerid,x,y,z);
HouseInfo[LoadedHauser][hEntrancex]=x;//drausen
HouseInfo[LoadedHauser][hEntrancey]=y;
HouseInfo[LoadedHauser][hEntrancez]=z;
HouseInfo[LoadedHauser][hExitx] = HausInterior[HausType][xx];//drine
HouseInfo[LoadedHauser][hExity] = HausInterior[HausType][yy];
HouseInfo[LoadedHauser][hExitz] = HausInterior[HausType][zz];
HouseInfo[LoadedHauser][hValue]=money;//Price
HouseInfo[LoadedHauser][hInt] = HausInterior[HausType][Inter];
HouseInfo[LoadedHauser][hLevel] = level;//LEVEL
HouseInfo[LoadedHauser][hHel] = 0;
HouseInfo[LoadedHauser][hArm] = 0;
HouseInfo[LoadedHauser][hHealthx] = 0;
HouseInfo[LoadedHauser][hHealthy] = 0;
HouseInfo[LoadedHauser][hHealthz] = 0;
HouseInfo[LoadedHauser][hArmourx] = 0;
HouseInfo[LoadedHauser][hArmoury] = 0;
HouseInfo[LoadedHauser][hArmourz] = 0;
HouseInfo[LoadedHauser][hLock] = 1;
HouseInfo[LoadedHauser][hOwned] = 0;
HouseInfo[LoadedHauser][hVec] = 418;
HouseInfo[LoadedHauser][hVcol1] = -1;
HouseInfo[LoadedHauser][hVcol2] = -1;
strmid(HouseInfo[LoadedHauser][hOwner], "The State", 0, strlen("The State"), 255);
strmid(HouseInfo[LoadedHauser][hDiscription], HausInterior[HausType][Name], 0, strlen(HausInterior[HausType][Name]), 255);
new string2[128];
format(string2, sizeof(string2), "[Haus zu verkaufen - %s]\nPreis: $%d\nLevel: %d\n/buyhouse zum kaufen",HouseInfo[LoadedHauser][hDiscription],HouseInfo[LoadedHauser][hValue],HouseInfo[LoadedHauser][hLevel]);
Update3DTextLabelText(HouseInfo[LoadedHauser][Text], COLOR_FORSELL, string2);
OnPropUpdate();
return 1;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist nicht befugt.");
}
}
return 1;
}
-
-
Am Ende des OnPlayerCommandText-Callback vielleicht ein return vergessen?
-
So gehört es richtig:
if(strcmp(cmd, "/chouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
new Float:x, Float:y, Float:z;
GetPlayerName(playerid, playername, sizeof(playername));
if(!strlen(strget(cmdtext,1)) || !strlen(strget(cmdtext,2)) || !strlen(strget(cmdtext,3)))
{
SendClientMessage(playerid, COLOR_GRAD2, "Benutzung: /chouse [Type1-12] [Kosten] [Level]");
return 0;
}
new HausType;
new money;
new level = strval(strget(cmdtext,3));
HausType = strval(strget(cmdtext,1));
money = strval(strget(cmdtext,2));
if (PlayerInfo[playerid][pAdmin] >= 2000)
{
GetPlayerPos(playerid,x,y,z);
HouseInfo[LoadedHauser][hEntrancex]=x;//drausen
HouseInfo[LoadedHauser][hEntrancey]=y;
HouseInfo[LoadedHauser][hEntrancez]=z;
HouseInfo[LoadedHauser][hExitx] = HausInterior[HausType][xx];//drine
HouseInfo[LoadedHauser][hExity] = HausInterior[HausType][yy];
HouseInfo[LoadedHauser][hExitz] = HausInterior[HausType][zz];
HouseInfo[LoadedHauser][hValue]=money;//Price
HouseInfo[LoadedHauser][hInt] = HausInterior[HausType][Inter];
HouseInfo[LoadedHauser][hLevel] = level;//LEVEL
HouseInfo[LoadedHauser][hHel] = 0;
HouseInfo[LoadedHauser][hArm] = 0;
HouseInfo[LoadedHauser][hHealthx] = 0;
HouseInfo[LoadedHauser][hHealthy] = 0;
HouseInfo[LoadedHauser][hHealthz] = 0;
HouseInfo[LoadedHauser][hArmourx] = 0;
HouseInfo[LoadedHauser][hArmoury] = 0;
HouseInfo[LoadedHauser][hArmourz] = 0;
HouseInfo[LoadedHauser][hLock] = 1;
HouseInfo[LoadedHauser][hOwned] = 0;
HouseInfo[LoadedHauser][hVec] = 418;
HouseInfo[LoadedHauser][hVcol1] = -1;
HouseInfo[LoadedHauser][hVcol2] = -1;
strmid(HouseInfo[LoadedHauser][hOwner], "The State", 0, strlen("The State"), 255);
strmid(HouseInfo[LoadedHauser][hDiscription], HausInterior[HausType][Name], 0, strlen(HausInterior[HausType][Name]), 255);
new string2[128];
format(string2, sizeof(string2), "[Haus zu verkaufen - %s]\nPreis: $%d\nLevel: %d\n/buyhouse zum kaufen",HouseInfo[LoadedHauser][hDiscription],HouseInfo[LoadedHauser][hValue],HouseInfo[LoadedHauser][hLevel]);
Update3DTextLabelText(HouseInfo[LoadedHauser][Text], COLOR_FORSELL, string2);
OnPropUpdate();
return 0;
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "Du bist nicht befugt.");
}
}
return 1;
} -
breadfish.de
Hat das Thema geschlossen.