Problem Zanima me kako da ove komande iz cmd prebacim u strcmp komandu
Dio skripte komande
CMD:kupistan(playerid, params)
{
if(InStanCP == -1) return SendClientMessage(playerid, 0xFF0000, "Nisi kod stana koji je na prodaju!");
if(StanInformation[InStanCP] != 0) return SendClientMessage(playerid, 0xFF0000, "Stan nije na prodaju");
if(GetPlayerMoney(playerid) < StanInformation[InStanCP]) return SendClientMessage(playerid, 0xFF0000, "Nemas dovoljno novca za kupnju!"); //Player has a lack of cash!
new PlayerName;
GetPlayerName(playerid, PlayerName, 24);
format(fquery, sizeof(fquery), "SELECT `houseowner` FROM `STANINFO` WHERE `stanowner` = '%s'", PlayerName); //Formats the SELECT query
queryresult = db_query(database, fquery); //Query result variable has been used to query the string above.
if(db_num_rows(queryresult) == MAX_STANS_PER_PLAYER) return SendClientMessage(playerid, 0xFF0000, "Ti vec imas stan"); //If the player has the max houses
db_free_result(queryresult);
//This is the point where the player can buy the house
SetOwner(StanInformation[InStanCP], PlayerName, InStanCP);
//SetOwner(HouseName[], ownername[], houseids)
SetPlayerPos(playerid, StanInformation[InStanCP], StanInformation[InStanCP], StanInformation[InStanCP]); //Sets players position where InHouseCP = houseid.
SetPlayerInterior(playerid, StanInformation[InStanCP]); //Sets players interior
SetPlayerVirtualWorld(playerid, 15500000 + InStanCP); //Sets the virtual world
GivePlayerMoney(playerid, - StanInformation[InStanCP]);
GameTextForPlayer(playerid, "Stan ~r~Kupljen!", 3000, 3); //Tells them they have purchased a house
return 1;
}
CMD:prodajstan(playerid, params)
{
if(InStan == -1) return SendClientMessage(playerid, 0xFF0000, "Ti moras imati sta nda bi ga prodao!");
new Pname;
GetPlayerName(playerid, Pname, 24);
if(strcmp(StanInformation[InStan], Pname) != 0) return SendClientMessage(playerid, 0xFF0000, "Ovo nije tvoj stan!");
//This is the point where the player can sell the house
DeleteOwner(StanInformation[InStan], InStan);
//DeleteOwner(HouseName[], houseids)
GivePlayerMoney(playerid, StanInformation[InStan]);
SetPlayerPos(playerid, StanInformation[InStan], StanInformation[InStan], StanInformation[InStan]);
SetPlayerInterior(playerid, 0); //Sets the player back to interior 0 (Outside)
SetPlayerVirtualWorld(playerid, 0); //Sets the players Virtual world to 0.
InStanCP = InStan;
GameTextForPlayer(playerid, "Stan ~g~prodan!", 3000, 3); //Tells them they have sold a house
return 1;
}