Skripta koju koristi mCLRP
Problem Zanima me kako da ove komande iz cmd prebacim u strcmp komandu
Dio skripte komande
CMD:kupistan(playerid, params)
{
if(InStanCP[playerid] == -1) return SendClientMessage(playerid, 0xFF0000, "Nisi kod stana koji je na prodaju!");
if(StanInformation[InStanCP[playerid]][owner][0] != 0) return SendClientMessage(playerid, 0xFF0000, "Stan nije na prodaju");
if(GetPlayerMoney(playerid) < StanInformation[InStanCP[playerid]][costprice]) return SendClientMessage(playerid, 0xFF0000, "Nemas dovoljno novca za kupnju!"); //Player has a lack of cash!
new PlayerName[24];
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[playerid]][Sname], PlayerName, InStanCP[playerid]);
//SetOwner(HouseName[], ownername[], houseids)
SetPlayerPos(playerid, StanInformation[InStanCP[playerid]][ExitPos][0], StanInformation[InStanCP[playerid]][ExitPos][1], StanInformation[InStanCP[playerid]][ExitPos][2]); //Sets players position where InHouseCP[playerid] = houseid.
SetPlayerInterior(playerid, StanInformation[InStanCP[playerid]][interiors]); //Sets players interior
SetPlayerVirtualWorld(playerid, 15500000 + InStanCP[playerid]); //Sets the virtual world
GivePlayerMoney(playerid, - StanInformation[InStanCP[playerid]][costprice]);
GameTextForPlayer(playerid, "Stan ~r~Kupljen!", 3000, 3); //Tells them they have purchased a house
return 1;
}
CMD:prodajstan(playerid, params)
{
if(InStan[playerid] == -1) return SendClientMessage(playerid, 0xFF0000, "Ti moras imati sta nda bi ga prodao!");
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(strcmp(StanInformation[InStan[playerid]][owner], Pname) != 0) return SendClientMessage(playerid, 0xFF0000, "Ovo nije tvoj stan!");
//This is the point where the player can sell the house
DeleteOwner(StanInformation[InStan[playerid]][Sname], InStan[playerid]);
//DeleteOwner(HouseName[], houseids)
GivePlayerMoney(playerid, StanInformation[InStan[playerid]][sellprice]);
SetPlayerPos(playerid, StanInformation[InStan[playerid]][EnterPos][0], StanInformation[InStan[playerid]][EnterPos][1], StanInformation[InStan[playerid]][EnterPos][2]);
SetPlayerInterior(playerid, 0); //Sets the player back to interior 0 (Outside)
SetPlayerVirtualWorld(playerid, 0); //Sets the players Virtual world to 0.
InStanCP[playerid] = InStan[playerid];
GameTextForPlayer(playerid, "Stan ~g~prodan!", 3000, 3); //Tells them they have sold a house
return 1;
}
neznam ak je uredo al probaj ovako
Citatif(strcmp(cmd, "/kupistan", true) == 0)
{
if(InStanCP[playerid] == -1) return SendClientMessage(playerid, 0xFF0000, "Nisi kod stana koji je na prodaju!");
if(StanInformation[InStanCP[playerid]][owner][0] != 0) return SendClientMessage(playerid, 0xFF0000, "Stan nije na prodaju");
if(GetPlayerMoney(playerid) < StanInformation[InStanCP[playerid]][costprice]) return SendClientMessage(playerid, 0xFF0000, "Nemas dovoljno novca za kupnju!"); //Player has a lack of cash!
new PlayerName[24];
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[playerid]][Sname], PlayerName, InStanCP[playerid]);
//SetOwner(HouseName[], ownername[], houseids)
SetPlayerPos(playerid, StanInformation[InStanCP[playerid]][ExitPos][0], StanInformation[InStanCP[playerid]][ExitPos][1], StanInformation[InStanCP[playerid]][ExitPos][2]); //Sets players position where InHouseCP[playerid] = houseid.
SetPlayerInterior(playerid, StanInformation[InStanCP[playerid]][interiors]); //Sets players interior
SetPlayerVirtualWorld(playerid, 15500000 + InStanCP[playerid]); //Sets the virtual world
GivePlayerMoney(playerid, - StanInformation[InStanCP[playerid]][costprice]);
GameTextForPlayer(playerid, "Stan ~r~Kupljen!", 3000, 3); //Tells them they have purchased a house
return 1;
}
if(strcmp(cmd, "/prodajstan", true) == 0)
{
if(InStan[playerid] == -1) return SendClientMessage(playerid, 0xFF0000, "Ti moras imati sta nda bi ga prodao!");
new Pname[24];
GetPlayerName(playerid, Pname, 24);
if(strcmp(StanInformation[InStan[playerid]][owner], Pname) != 0) return SendClientMessage(playerid, 0xFF0000, "Ovo nije tvoj stan!");
//This is the point where the player can sell the house
DeleteOwner(StanInformation[InStan[playerid]][Sname], InStan[playerid]);
//DeleteOwner(HouseName[], houseids)
GivePlayerMoney(playerid, StanInformation[InStan[playerid]][sellprice]);
SetPlayerPos(playerid, StanInformation[InStan[playerid]][EnterPos][0], StanInformation[InStan[playerid]][EnterPos][1], StanInformation[InStan[playerid]][EnterPos][2]);
SetPlayerInterior(playerid, 0); //Sets the player back to interior 0 (Outside)
SetPlayerVirtualWorld(playerid, 0); //Sets the players Virtual world to 0.
InStanCP[playerid] = InStan[playerid];
GameTextForPlayer(playerid, "Stan ~g~prodan!", 3000, 3); //Tells them they have sold a house
return 1;
}
Prijaviti moderatoru Evidentirano
Trazim Pomocnog Mappera Za server kazite mi na PM ako ste zainteresirani.Nagrada kakvu ocete
kolko sam znao sam probao neke komande rade tako a neke ne al kolko znam puno ti je bolje koristti ZCMD tj. brze,bolje je :)
Ma sreido sam vec......ma znam al kad mi je cjeli mod u strcmp i sad mi je bezz dodavati cmd xD
ajde Moze Ovdje Lock