Medic Problem
#1

When someone is already accepted the patient, the other are allowed to accept it too, i need some help to fix this please.
PHP код:
CMD:getpt(playeridparams[])
{
    if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pFaction] == 3)
    {
        new 
string[128], giveplayerid;
        if(
sscanf(params"u"giveplayerid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /getpt(patient) [playerid/partofname]");
        if(
IsPlayerConnected(giveplayerid))
        {
            if(
giveplayerid == playerid)
            {
                
SendClientMessage(playeridCOLOR_LIGHTBLUE"You can't accept your own Emergency Dispatch call!");
                return 
1;
            }
            if(
GetPVarInt(giveplayerid,"MedicCall") == 1)
            {
                new 
bool:available true;
                foreach(new 
Player)
                {
                    if(
EMSAccepted[i] == giveplayerid || SetPVarInt(playerid,"EMSAttempt"2))
                    {
                        
available true;
                        break;
                    }
                }
                if(!
available)
                    return 
SendClientMessage(playeridCOLOR_GREY"That player is already being attended by another medic.");
                    
                if(
PlayerInfo[giveplayerid][pJailed] > 0) return SendClientMessage(playeridCOLOR_GRAD2"You can't use this command on jailed players.");
                
format(stringsizeof(string), "EMS Driver %s has accepted the Emergency Dispatch call for (%d) %s.",GetPlayerNameEx(playerid),giveplayerid,GetPlayerNameEx(giveplayerid));
                
SendRadioMessage(3TEAM_MED_COLORstring);
                
format(stringsizeof(string), "* You have accepted EMS Call from %s, you will see the marker until you have reached it.",GetPlayerNameEx(giveplayerid));
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
                
format(stringsizeof(string), "* EMS Driver %s has accepted your EMS Call; please wait at your current position.",GetPlayerNameEx(playerid));
                
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring);
                
GameTextForPlayer(playerid"~w~EMS Caller~n~~r~Go to the red marker."50001);
                
EMSCallTime[playerid] = 1;
                
EMSAccepted[playerid] = giveplayerid;
                
SetPVarInt(giveplayerid"EMSAttempt"1);
                
PlayerInfo[playerid][pCallsAccepted]++;
            }
            else
            {
                
SendClientMessage(playeridCOLOR_WHITE"The player has not requested any EMS attention!");
            }
        }
    }
    return 
1;

Reply
#2

try this
PHP код:
CMD:getpt(playeridparams[]) 

    if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pFaction] == 3
    { 
        new 
string[128], giveplayerid
        if(
sscanf(params"u"giveplayerid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /getpt(patient) [playerid/partofname]"); 
        if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playeridCOLOR_LIGHTBLUE"That player is not connected"); 
        if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_LIGHTBLUE"You can't accept your own Emergency Dispatch call!"); 
        if(
GetPVarInt(giveplayerid,"MedicCall") == 1
        { 
                new 
bool:available true
                foreach(new 
Player
                { 
                    if(
EMSAccepted[i] == giveplayerid || SetPVarInt(playerid,"EMSAttempt"2)) 
                    { 
                        
available true
                        break; 
                    } 
                } 
                if(
available==1
                    return 
SendClientMessage(playeridCOLOR_GREY"That player is already being attended by another medic."); 
                     
                if(
PlayerInfo[giveplayerid][pJailed] > 0) return SendClientMessage(playeridCOLOR_GRAD2"You can't use this command on jailed players."); 
                
format(stringsizeof(string), "EMS Driver %s has accepted the Emergency Dispatch call for (%d) %s.",GetPlayerNameEx(playerid),giveplayerid,GetPlayerNameEx(giveplayerid)); 
                
SendRadioMessage(3TEAM_MED_COLORstring); 
                
format(stringsizeof(string), "* You have accepted EMS Call from %s, you will see the marker until you have reached it.",GetPlayerNameEx(giveplayerid)); 
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring); 
                
format(stringsizeof(string), "* EMS Driver %s has accepted your EMS Call; please wait at your current position.",GetPlayerNameEx(playerid)); 
                
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring); 
                
GameTextForPlayer(playerid"~w~EMS Caller~n~~r~Go to the red marker."50001); 
                
EMSCallTime[playerid] = 1
                
EMSAccepted[playerid] = giveplayerid
                
SetPVarInt(giveplayerid"EMSAttempt"1); 
                
PlayerInfo[playerid][pCallsAccepted]++; 
        } 
        else 
        { 
                
SendClientMessage(playeridCOLOR_WHITE"The player has not requested any EMS attention!"); 
        } 
    } 
    return 
1

Reply
#3

Quote:
Originally Posted by ProScripter
Посмотреть сообщение
try this
PHP код:
CMD:getpt(playeridparams[]) 

    if(
PlayerInfo[playerid][pLeader] == || PlayerInfo[playerid][pFaction] == 3
    { 
        new 
string[128], giveplayerid
        if(
sscanf(params"u"giveplayerid)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /getpt(patient) [playerid/partofname]"); 
        if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playeridCOLOR_LIGHTBLUE"That player is not connected"); 
        if(
giveplayerid == playerid) return SendClientMessage(playeridCOLOR_LIGHTBLUE"You can't accept your own Emergency Dispatch call!"); 
        if(
GetPVarInt(giveplayerid,"MedicCall") == 1
        { 
                new 
bool:available true
                foreach(new 
Player
                { 
                    if(
EMSAccepted[i] == giveplayerid || SetPVarInt(playerid,"EMSAttempt"2)) 
                    { 
                        
available true
                        break; 
                    } 
                } 
                if(
available==1
                    return 
SendClientMessage(playeridCOLOR_GREY"That player is already being attended by another medic."); 
                     
                if(
PlayerInfo[giveplayerid][pJailed] > 0) return SendClientMessage(playeridCOLOR_GRAD2"You can't use this command on jailed players."); 
                
format(stringsizeof(string), "EMS Driver %s has accepted the Emergency Dispatch call for (%d) %s.",GetPlayerNameEx(playerid),giveplayerid,GetPlayerNameEx(giveplayerid)); 
                
SendRadioMessage(3TEAM_MED_COLORstring); 
                
format(stringsizeof(string), "* You have accepted EMS Call from %s, you will see the marker until you have reached it.",GetPlayerNameEx(giveplayerid)); 
                
SendClientMessage(playeridCOLOR_LIGHTBLUEstring); 
                
format(stringsizeof(string), "* EMS Driver %s has accepted your EMS Call; please wait at your current position.",GetPlayerNameEx(playerid)); 
                
SendClientMessage(giveplayeridCOLOR_LIGHTBLUEstring); 
                
GameTextForPlayer(playerid"~w~EMS Caller~n~~r~Go to the red marker."50001); 
                
EMSCallTime[playerid] = 1
                
EMSAccepted[playerid] = giveplayerid
                
SetPVarInt(giveplayerid"EMSAttempt"1); 
                
PlayerInfo[playerid][pCallsAccepted]++; 
        } 
        else 
        { 
                
SendClientMessage(playeridCOLOR_WHITE"The player has not requested any EMS attention!"); 
        } 
    } 
    return 
1

tag mismatch on this

if(available==1)
Reply
#4

Quote:
Originally Posted by TitoRayne
Посмотреть сообщение
tag mismatch on this

if(available==1)
if(available == 1)
Reply
#5

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
if(available == 1)
still the same, tried that already bruv.
Reply
#6

Quote:
Originally Posted by Zeus666
Посмотреть сообщение
if(available == 1)
set it if(availabel = 1)
Reply
#7

Quote:
Originally Posted by ProScripter
Посмотреть сообщение
set it if(availabel = 1)
Recieved three error including mismatch
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)