[POMOC]CMD

Započeo Matrix_Green
31. Jan. 2012. Zaključano
445
pregleda
3
postova
sandman12wolf
4
Enforcer
31. Jan. 2012.
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 == -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;
}
Deleted User
Obrisan korisnik
31. Jan. 2012.
neznam ak je uredo al probaj ovako

Quote
if(strcmp(cmd, "/kupistan", true) == 0)
{
    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;
}
if(strcmp(cmd, "/prodajstan", true) == 0)
{
    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;
}

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 🙂
sandman12wolf
4
Enforcer
31. Jan. 2012.
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

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha