if(PRESSED(KEY_WALK))
{
if(team[playerid] == TEAM_ZOMBIE)
{
if(pInfo[playerid][pZombieClass] == ROGUEZOMBIE)
{
if(gettime() - 60 < Abilitys[playerid][ChangeSkinZombie]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
{
Abilitys[playerid][ChangeSkinZombie] = gettime();
SetPlayerColor(playerid,COLOR_HUMAN);
switch(random(5))
{
case 0: SetPlayerSkin(playerid,5);
case 1: SetPlayerSkin(playerid,23);
case 2: SetPlayerSkin(playerid,56);
case 3: SetPlayerSkin(playerid,289);
case 4: SetPlayerSkin(playerid,299);
}
}
}
}
}
if(gettime() - 60 < Abilitys[playerid][ChangeSkinZombie]) return GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
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(playerid, COLOR_HUMAN);
static RandomHumanSkin[] = {
5, 23, 56, 289, 299
};
SetPlayerSkin(playerid, RandomHumanSkin[random(sizeof(RandomHumanSkin) - 1)]); // now you don't need to specify quantities
SetTimerEx("ReturnBack", 1000*30, false, "i", playerid);
} else {
GameTextForPlayer(playerid,"~w~ Still recovering",1000,5);
}
}
}
return 1;
}
forward ReturnBack(playerid);
public ReturnBack(playerid)
{
SetPlayerSkin(playerid, GetPVarInt("afterSkin"));
SetPlayerColor(playerid, GetPVarInt("afterColor"));
return 1;
}
|
PHP код:
And you can return name and skin to player with some like this: PHP код:
|
SetPlayerSkin(playerid, GetPVarInt("afterSkin"));
SetPlayerColor(playerid, GetPVarInt("afterColor"));
GetPVarInt(playerid, varname[]);
forward ReturnBack(playerid);
public ReturnBack(playerid)
{
SetPlayerSkin(playerid, GetPVarInt(playerid, "afterSkin"));
SetPlayerColor(playerid, GetPVarInt(playerid, "afterColor"));
return 1;
}
|
https://sampwiki.blast.hk/wiki/GetPVarInt
PHP код:
PHP код:
|