Give something for couple seconds
#3

Quote:
Originally Posted by Zume
Посмотреть сообщение
PHP код:
if(gettime() - 60 Abilitys[playerid][ChangeSkinZombie]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5); 
This is a error, why? if you have more keys with the same key in this callback below this not won't be executed

And you can return name and skin to player with some like this:

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    if(
PRESSED(KEY_WALK)) {
         if(
team[playerid] == TEAM_ZOMBIE && pInfo[playerid][pZombieClass] == ROGUEZOMBIE) {
              if(
Abilitys[playerid][ChangeSkinZombie] < gettime()){
                
SetPVarInt(playerid"afterColor"GetPlayerColor(playerid));
                
SetPVarInt(playerid"afterSkin"GetPlayerSkin(playerid));
                
                
Abilitys[playerid][ChangeSkinZombie] = gettime() + 60;
                
SetPlayerColor(playeridCOLOR_HUMAN);
                static 
RandomHumanSkin[] = { 
                    
52356289299
                
};
                
SetPlayerSkin(playeridRandomHumanSkin[random(sizeof(RandomHumanSkin) - 1)]); // now you don't need to specify quantities
                
SetTimerEx("ReturnBack"1000*30false"i"playerid);
              } else {
                  
GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
              }
        }
    }
    return 
1;
}
forward ReturnBack(playerid);
public 
ReturnBack(playerid)
{
    
SetPlayerSkin(playeridGetPVarInt("afterSkin"));
    
SetPlayerColor(playeridGetPVarInt("afterColor"));
    return 
1;

But GetPlayerColor only works if you used SetPlayerColor before
Got these error
error 035: argument type mismatch (argument 1)
at this lines
Код:
    SetPlayerSkin(playerid, GetPVarInt("afterSkin"));

    SetPlayerColor(playerid, GetPVarInt("afterColor"));
Reply


Messages In This Thread
Give something for couple seconds - by henkas - 16.10.2016, 16:40
Respuesta: Give something for couple seconds - by Zume - 16.10.2016, 18:18
Re: Respuesta: Give something for couple seconds - by henkas - 17.10.2016, 12:32
Re: Give something for couple seconds - by henkas - 17.10.2016, 12:51
Re: Give something for couple seconds - by henkas - 17.10.2016, 16:15
Re: Give something for couple seconds - by henkas - 17.10.2016, 18:37
Re: Give something for couple seconds - by jlalt - 17.10.2016, 18:40
Re: Give something for couple seconds - by henkas - 17.10.2016, 19:42

Forum Jump:


Users browsing this thread: 3 Guest(s)