Challenge
#2

I do not understand what you want, but I think maybe this will help you

PHP код:
CMD:challenge(playeridparams[])
{
    new 
id;
    if(
sscanf(params,"d"id)) {
        
SCM(playerid, -1"usage: /challenge [playerid]");
    }
    else {
        if(
onCheck[id] == false) { // checking id already on challenge or not
            
onCheck[id] = true
            
SCM(id, -1"you have set to challenge mode"); // send id message
            
new str[128];
            
format(str,sizeof(str),"you have set %s to challenge mode"GetName(id));
            
SCM(playerid, -1str);
            
SetPlayerCheckpoint(id1982.6150, -220.6680, -0.24323.0); // setting id checkpoint
        
}
        else {
            
SCM(playerid, -1"player is already on challenge mode");
        }
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
onCheck[playerid] = false// set challenge to false
    
return 1;
}
public 
OnPlayerEnterCheckpoint(playerid

    if(
onCheck[playerid]) {  // if it's true   
        
GivePlayerMoney(playerid1000); 
        
DisablePlayerCheckpoint(playerid); 
        
onCheck[playerid] = false
    } 
    return 
1
}  
    
public 
OnPlayerSpawn(playerid

    if(
onCheck[playerid]) { // check if id already on challenge
        
SetPlayerCheckpoint(playerid1982.6150, -220.6680, -0.24323.0); 
        
SCM(id, -1"you have enter challenge mode");
    }
    else if(!
onCheck[playerid]) {
        
DisablePlayerCheckpoint(playerid); // disable checkpoint
    
}
    return 
1

Reply


Messages In This Thread
Challenge - by Loinal - 07.02.2017, 08:50
Re: Challenge - by kloning1 - 07.02.2017, 09:01
Re: Challenge - by Loinal - 07.02.2017, 09:34
Re: Challenge - by Loinal - 07.02.2017, 10:45

Forum Jump:


Users browsing this thread: 1 Guest(s)