Ajutor
#1

Salut, vreau sa fac la comenzile /asellhouse, /asellbiz si /asellsbiz sa pot seta valoarea la stat.

Este GM bazat pe MySQL si comenzile arata cam asa:
PHP код:
CMD:asellsbiz(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
IsPlayerConnected(playerid))
    {
        new 
house,value,str2[256];
        if(
sscanf(params"d"house,value)) return SendClientMessage(playerid0xFFFFFFFF"{B8DBFF}Synthax: /asellbiz <Biz ID> <BuyPrice>");
        if (
PlayerInfo[playerid][pAdmin] >= 5)
        {
            new 
ownerh[64],field[128];
            
format(field,128,"SELECT `Owner` FROM `sbizz` WHERE `ID`='%d'",house);
            
mysql_query(SQL,field);
            
mysql_store_result();
            if(
mysql_retrieve_row())
            {
                
mysql_fetch_field_row(ownerh"Owner");
            }
            
mysql_free_result();
            
SBizzInfo[house][sbLocked] = 0;
            
SBizzInfo[house][sbOwned] = 0;
            
strmid(SBizzInfo[house][sbOwner], "The State"0strlen("The State"), 255);
            
PlayerPlaySound(playerid10520.00.00.0);
            
GameTextForPlayer(playerid"~w~You have sold this property"100003);
            
format(str2,sizeof(str2),"UPDATE `sbizz` SET `BuyPrice`='%d',`Owned`='0',`Owner`='The State', WHERE `ID`='%d'",value,house);
            
mysql_query(SQL,str2);
            
format(str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
            
mysql_query(SQL,str2);
            
OnPropTextdrawUpdate(3house);
            return 
1;
        }
        else return 
SendClientMessage(playeridCOLOR_WHITE"{5CAD5C}Error: Your admin level isn't high enough to use this command.");
    }
    return 
1;
}
CMD:asellbiz(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
IsPlayerConnected(playerid))
    {
        new 
house,value,str2[256];
        if(
sscanf(params"d"house,value)) return SendClientMessage(playerid0xFFFFFFFF"{B8DBFF}Synthax: /asellbiz <Biz ID> <BuyPrice>");
        if (
PlayerInfo[playerid][pAdmin] >= 5)
        {
            new 
ownerh[64],field[128];
            
format(field,128,"SELECT `Owner` FROM `bizz` WHERE `ID`='%d'",house);
            
mysql_query(SQL,field);
            
mysql_store_result();
            if(
mysql_retrieve_row())
            {
                
mysql_fetch_field_row(ownerh"Owner");
            }
            
mysql_free_result();
            
BizzInfo[house][bLocked] = 0;
            
BizzInfo[house][bOwned] = 0;
            
strmid(BizzInfo[house][bOwner], "The State"0strlen("The State"), 255);
            
PlayerPlaySound(playerid10520.00.00.0);
            
GameTextForPlayer(playerid"~w~You have sold this property"100003);
            
format(str2,sizeof(str2),"UPDATE `bizz` SET `BuyPrice`='%d',`Owned`='0',`Owner`='The State',`BuyPrice`='%d' WHERE `ID`='%d'",value,house);
            
mysql_query(SQL,str2);
            
format(str2,sizeof(str2),"UPDATE users SET `Bizz`='255' WHERE `name`='%s'",ownerh);
            
mysql_query(SQL,str2);
            
OnPropTextdrawUpdate(2house);
            return 
1;
        }
        else return 
SendClientMessage(playeridCOLOR_WHITE"{5CAD5C}Error: Your admin level isn't high enough to use this command.");
    }
    return 
1;
}
CMD:asellhouse(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
IsPlayerConnected(playerid))
    {
        new 
house,value,str2[256];
        if(
sscanf(params"d"house,value)) return SendClientMessage(playerid0xFFFFFFFF"{B8DBFF}Synthax: /asellhouse <House ID> <Value>");
        if (
PlayerInfo[playerid][pAdmin] >= 5)
        {
            new 
ownerh[64],field[128];
            
format(field,128,"SELECT `Owner` FROM `houses` WHERE `ID`='%d'",house);
            
mysql_query(SQL,field);
            
mysql_store_result();
            if(
mysql_retrieve_row())
            {
                
mysql_fetch_field_row(ownerh"Owner");
            }
            
mysql_free_result();
            
HouseInfo[house][hHel] = 0;
            
HouseInfo[house][hArm] = 0;
            
HouseInfo[house][hLock] = 0;
            
HouseInfo[house][hOwned] = 0;
            
strmid(HouseInfo[house][hOwner], "The State"0strlen("The State"), 255);
            
PlayerPlaySound(playerid10520.00.00.0);
            
format(str2,sizeof(str2),"UPDATE `houses` SET `Hel`='0',`Arm`='0',`Value`='%d',`Owned`='0',`Owner`='The State', WHERE `ID`='%d'",value,house);
            
mysql_query(SQL,str2);
            
format(str2,sizeof(str2),"UPDATE `users` SET `House`='999' WHERE `name`='%s'",ownerh);
            
mysql_query(SQL,str2);
            
OnPropTextdrawUpdate(1house);
            return 
1;
        }
        else
        {
            
SendClientMessage(playeridCOLOR_WHITE"{5CAD5C}Error: Your admin level isn't high enough to use this command.");
        }
    }
    return 
1;


Ce gresesc? Ma puteti ajuta va rog?


Si daca se poate o comanda de /apark?

Asta este comanda de /park:
PHP код:
CMD:park(playeridparams[])
{
    if(
gPlayerLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"You need to login first.");
    if(
PlayerInfo[playerid][pPcarkey] == && PlayerInfo[playerid][pmotokey] == && PlayerInfo[playerid][phelikey] == && PlayerInfo[playerid][pprcarkey] == 0) return SendClientMessage(playerid,COLOR_WHITE,"{FFB870}You do not have a vehicle.");
    if(
personalcar[playerid] == 0) return SCM(playerid,COLOR_WHITE,"{FFB870}You don't have spawned car.");
    new 
engine,lights,alarm,doors,bonnet,boot,objective;
    new 
Float:x,Float:y,Float:z,Float:a,getcarid;
    
getcarid GetPlayerVehicleID(playerid);
    
GetVehiclePos(getcaridxyz);
    
GetVehicleZAngle(getcarida);
    if(
GetPlayerVehicleID(playerid) == personalcar[playerid])
    {
        if(
IsPlayerInVehicle(playerid,personalcar[playerid]))
        {
            new 
Float:health2;
            
GetVehicleHealth(getcaridhealth2);
            if(
health2 600.0) return SCM(playerid,COLOR_WHITE,"{FFB870}Please repair your car.");
            if(
getcarid == personalcar[playerid])
            {
                
CarInfo[OwnedVeh(getcarid)][cLocationx] = x;
                
CarInfo[OwnedVeh(getcarid)][cLocationy] = y;
                
CarInfo[OwnedVeh(getcarid)][cLocationz] = z;
                
CarInfo[OwnedVeh(getcarid)][cAngle] = a;
                
DestroyVehicle(personalcar[playerid]);
                new 
created OwnedVeh(getcarid);
                
OwnedVeh(getcarid) = 0;
                 new 
car CreateVehicle(CarInfo[created][cModel],CarInfo[created][cLocationx],CarInfo[created][cLocationy],CarInfo[created][cLocationz]+1.0,CarInfo[created][cAngle],CarInfo[created][cColorOne],CarInfo[created][cColorTwo],500000);
                
OwnedVeh(car) = created;
                
personalcar[playerid] = car;
                
PutPlayerInVehicleEx(playerid,car,0);
                new 
carplate[25];
                
format(carplatesizeof(carplate), "%s",CarInfo[OwnedVeh(car)][cLicense]);
                
SetVehicleNumberPlate(carcarplate);
                  
SetVehicleHealth(carhealth2);
                  
vehEngine[car] = 0;
                
GetVehicleParamsEx(car,engine,lights,alarm,doors,bonnet,boot,objective);
                  
SetVehicleParamsEx(car,VEHICLE_PARAMS_OFF,lights,alarm,CarInfo[PlayerInfo[playerid][pPcarkey]][cLock],bonnet,boot,objective);
                
SetPVarInt(playerid"Engine"0);
                
vUpdate(OwnedVeh(car),cLocationxx);
                
vUpdate(OwnedVeh(car),cLocationyx);
                
vUpdate(OwnedVeh(car),cLocationzx);
                
vUpdate(OwnedVeh(car),cAnglex);
                
ModVehicle(car);
                
SendClientMessage(playeridCOLOR_WHITE"Car was parked successfully.");
                return 
1;
            }
        }
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)