Some question
#1

I was add 2 codes in my gm, but it may something went wrong
Code 1 :
PHP код:
CMD:naubanhpizza(playeridparams[])
{
    if (!
IsPlayerInRangeOfPoint(playerid3.0375.5077, -118.80281001.4995)) return SendClientMessage(playeridCOLOR_GREY"Toan bo khu mua bao hiem da bi khoa, hay ra sfvip de mua baohiem.");
    {
    
SendClientMessage(playeridCOLOR_GREEN,"Ban da che tao banh pizza.");
    
PlayerInfo[playerid][pRFLTeam]= 1;
    return 
1;
    }

Code 2 :
PHP код:
CMD:datbanhlenxe(playeridparams[])
{
    if(
PlayerInfo[playerid][pRFLTeam] != 0)
    {
        
SendClientMessageEx(playerid,COLOR_GREY," Ban chua nau banh pizza !");
    }
    else
    {
        new 
closestcar GetClosestCar(playerid);
        if(
IsPlayerInRangeOfVehicle(playeridclosestcar10.0))
        {
            if(!
IsABike(closestcar))
            {
                
SendClientMessageEx(playerid,COLOR_GREY," Ban khong gan mot chiec xe nao do !");
            }
            if(
PlayerInfo[playerid][pRFLTeam] == 1)
            {
            
PlayerInfo[playerid][pFallIntoFun] = 1;
            }
          }
        }
            return 
1;

the code 1 i made to set player pRFLTeam = 1, so that player can use the next cmd(/duabanhlenxe), but when i type , it always told me didnt have a pice ( it mean pRFLTeam = 0)
Could sbdy help and edit for me please
Reply
#2

pawn Код:
CMD:naubanhpizza(playerid, params[])
{
    if (!IsPlayerInRangeOfPoint(playerid, 3.0, 375.5077, -118.8028, 1001.4995))
    {
        SendClientMessage(playerid, COLOR_GREY, "Toan bo khu mua bao hiem da bi khoa, hay ra sfvip de mua baohiem.");
        return 1;
    }
    SendClientMessage(playerid, COLOR_GREEN,"Ban da che tao banh pizza.");
    PlayerInfo[playerid][pRFLTeam]= 1;
    return 1;
}
Reply
#3

In code 2, change this line

Код:
if(PlayerInfo[playerid][pRFLTeam] != 0)
and make it

Код:
if(PlayerInfo[playerid][pRFLTeam] == 0)
Reply
#4

Thanks to all that the code 2 is working, but i got problem number 3 is when i type this code, it said the player didnt pFallintofun = 1, so it doesnt work as all

Here is the code 3
Quote:

CMD:getpizza(playerid, params[]) {
if(PlayerInfo[playerid][pJob] != 21 && PlayerInfo[playerid][pJob2] != 21) {
SendClientMessageEx(playerid,COLOR_GREY," Ban khong phai la Pizza Boy!");
}
else if(PlayerInfo[playerid][pFallIntoFun] != 0) {
SendClientMessageEx(playerid,COLOR_GREY," Ban chua nau banh pizza hoac cho banh pizza vao xe!");
}
else if(!IsAPizzaCar(GetPlayerVehicleID(playerid))) {
SendClientMessageEx(playerid,COLOR_GREY," ban can to be driving a pizzaboy found at the side of the Pizza Stack!");
}
else if(GetPlayerSkin(playerid) != 155) {
SendClientMessageEx(playerid,COLOR_GREY," ban can to be in the Pizza Stack uniform!");
}
else if(GetPVarType(playerid, "Pizza")) {
SendClientMessageEx(playerid, COLOR_GREY, " You are already delivering pizzas!");
}
else if(!IsPlayerInRangeOfPoint(playerid, 3.0, -1713.961425, 1348.545166, 7.180452)) {
SendClientMessageEx(playerid,COLOR_GREY," Ban khong phai lat the Pizza Stack pickup!");
}
else {

new rand = random(MAX_HOUSES - 1), i;
while(!(HouseInfo[rand][hOwned] && HouseInfo[rand][hExteriorZ] <= 100 && HouseInfo[rand][hExteriorX] > -2802.389648 && HouseInfo[rand][hExteriorX] < -1400.710327 && HouseInfo[rand][hExteriorY] < 2800 && HouseInfo[rand][hExteriorY] > -216.298019)) {
if(++rand >= MAX_HOUSES) {
rand = 0;
}
if (i++ > MAX_HOUSES) return 1;
}

new
iDist = floatround(GetPlayerDistanceFromPoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ])),
szMessage[86];

SetPVarInt(playerid, "tpPizzaTimer", iDist / 80);
SetPVarInt(playerid, "pizzaTotal", iDist / 10);
SetPVarInt(playerid, "pizzaTimer", iDist / 10);
SetPVarInt(playerid, "Pizza", rand);

SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_TPPIZZARUNTIMER);
SetTimerEx("OtherTimerEx", 1000, false, "ii", playerid, TYPE_PIZZATIMER);

format(szMessage, sizeof(szMessage), "ban da picked up a pizza for %s. ban da %d seconds to deliver it!", StripUnderscore(HouseInfo[rand][hOwnerName]), iDist / 10);
SendClientMessageEx(playerid, COLOR_WHITE, szMessage);

SetPlayerCheckpoint(playerid, HouseInfo[rand][hExteriorX], HouseInfo[rand][hExteriorY], HouseInfo[rand][hExteriorZ], 5);
}
return 1;
}

And the string for code 1 and code 2
Quote:

}
else if(PlayerInfo[playerid][pFallIntoFun] != 0) {
SendClientMessageEx(playerid,COLOR_GREY," Ban chua nau banh pizza hoac cho banh pizza vao xe!");

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)