Hey how to add alt to dcmd_robstore?
#1

hey i have been trying to find a way on how to make dcmd_robstore when people press alt here is the dcmd_robstore
PHP код:
dcmd_robstore(playerid,params[])
{
    new 
string[128];
    
#pragma unused params
    
if(IsSpawned[playerid] != 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You must be alive and spawned in order to be able to use this command.");
        return 
1;
 }
    if(
IsKidnapped[playerid] == 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You are kidnapped. You cannot use this command.");
        return 
1;
    }
    if(
IsFrozen[playerid] == 1)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You have been frozen by a Server Administrator. You cannot use this command.");
        return 
1;
    }
    if(!
IsPlayerInCheckpoint(playerid))
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You are not in the checkpoint of anywhere you can rob.");
        return 
1;
    }
    if(
gTeam[playerid] == TEAM_COP || gTeam[playerid] == TEAM_ARMY || gTeam[playerid] == TEAM_CIA || gTeam[playerid] == TEAM_MEDIC)
    {
         
SendClientMessage(playerid,COLOR_ERROR,"You cannot rob things with your class/skill.");
        return 
1;
    }
    if(
getCheckpointType(playerid) != CP_BurgerShotMain && getCheckpointType(playerid) != CP_CluckinBellMain &&
    
getCheckpointType(playerid) != CP_Ammunation && getCheckpointType(playerid) != CP_GayDarMain &&
    
getCheckpointType(playerid) != CP_ZeroMain && getCheckpointType(playerid) != CP_MistysMain &&
    
getCheckpointType(playerid) != CP_GYM && getCheckpointType(playerid) != CP_School &&
    
getCheckpointType(playerid) != CP_WangCars && getCheckpointType(playerid) != CP_Train &&
    
getCheckpointType(playerid) != CP_Barbers && getCheckpointType(playerid) != CP_PizzaMain &&
    
getCheckpointType(playerid) != CP_ZipMain && getCheckpointType(playerid) != CP_VictimMain &&
    
getCheckpointType(playerid) != CP_BincoMain && getCheckpointType(playerid) != CP_CityHallMain)
    {
        
SendClientMessage(playerid,COLOR_ERROR,"You are not in the checkpoint of anywhere you can rob.");
        return 
1;
    }
    new 
current_zone player_zone[playerid];
    new 
rrand =random(100);
    if(
getCheckpointType(playerid) == CP_BurgerShotMain)
    {
        if(
zones[current_zone][zone_name] == zones[116][zone_name] || zones[current_zone][zone_name] == zones[117][zone_name])
        {
            if(
GarciaBurgerShotRobbedRecently >= 1)
            {
                
SendClientMessage(playerid,COLOR_ERROR,"The Garcia Burger Shot has been robbed recently.");
                return 
1;
            }
            if(
rrand <= 30)
            {
                
SendClientMessage(playerid,COLOR_ERROR,"Garcia Burger Shot robbery failed.");
                
GarciaBurgerShotRobbedRecently =320;
                return 
1;
            }
            
GarciaBurgerShotRobbedRecently =320;
            
RobbingGarciaBurgerShot[playerid] =25;
            
IncreaseWantedLevel(playerid,4);
            
IncreasePlayerScore(playerid,1);
            
format(string,sizeof(string),"[POLICE RADIO] Suspect %s(%d) has begun to rob the Garcia Burger Shot! Get To Burger Shot and arrest the suspect.",PlayerName(playerid),playerid);
            
SendClientMessageToAllCops(string);
            
format(string,sizeof(string),"[ROBBERY] %s(%d) has begun a robbery at Burger Shot ..",PlayerName(playerid),playerid);
            
SendClientMessageToAll(COLOR_RED,string);
            
format(string,sizeof(string),"4[ROBBERY] %s(%d) has begun a robbery at Burger Shot ..",PlayerName(playerid),playerid);
            
IRC_GroupSay(gGroupID,IRC_CHANNEL,string);
            return 
1;
        } 

This the function KEY i want use
PHP код:
    if (PRESSKEY_WALK )) && dcmd(robstore,8,cmdtext);
    {
              if(
getCheckpointType(playerid) != CP_BurgerShotMain && getCheckpointType(playerid) != CP_CluckinBellMain &&
            
getCheckpointType(playerid) != CP_Ammunation && getCheckpointType(playerid) != CP_GayDarMain &&
            
getCheckpointType(playerid) != CP_ZeroMain && getCheckpointType(playerid) != CP_MistysMain &&
            
getCheckpointType(playerid) != CP_GYM && getCheckpointType(playerid) != CP_School &&
            
getCheckpointType(playerid) != CP_WangCars && getCheckpointType(playerid) != CP_Train &&
            
getCheckpointType(playerid) != CP_Barbers && getCheckpointType(playerid) != CP_PizzaMain &&
            
getCheckpointType(playerid) != CP_ZipMain && getCheckpointType(playerid) != CP_VictimMain &&
            
getCheckpointType(playerid) != CP_BincoMain && getCheckpointType(playerid) != CP_CityHallMain)
        return 
1;
    } 
Reply
#2

I do not really understand what you mean, but if you mean you want to make it so you press alt to rob the store then look at these functions on the samp wiki.

https://sampwiki.blast.hk/wiki/OnPlayerKeyStateChange

Hope I helped, Connor.
Reply
#3

never mind buddy i have lol thanks alot for trying to help

it was this lol
Quote:

if (PRESS( KEY_WALK ))
{
dcmd_robstore(playerid,"");
return 1;
}

lol i did by my self thanks for help anyways once again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)