YCMD:usedrugs(playerid,params[],help)
{
new option[10];
if(sscanf(params,"s[10]",option)) return SendClientMessage(playerid,COLOR_WHITE,""blue""red"UPORABA:"white""white" /usedrugs [Option] | Options: heroin, ((weed))");
if(strcmp(option,"heroin") == 0)
{
if(pInfo[playerid][Drugs] >= 51)
{
new Floar:armour;
GetPlayerArmour(playerid, Float:armour);
SetPlayerArmour(playerid, Float:armour + 50);
pInfo[playerid][Drugs] = pInfo[playerid][Drugs] - 50;
GetPlayerArmour(playerid, Float:armour);
if(Float:armour >= 101) SetPlayerArmour(playerid, 100);
ClearAnimations(playerid);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 0, 0,0, 15000, 0);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerWeather(playerid, -66);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
SetTimerEx("Drugsoff", 15000, 0, "i", playerid);
for(new i; i < MAX_PLAYERS; i++)
if(IsPlayerInRangeOfPoint(i, 20.0, x,y,z))
{
new string[128];
format(string,sizeof(string),"* %s vzema heroin.",pName);
SendClientMessage(i,COLOR_ACTION,string);
}
}
else return SendClientMessage(playerid,COLOR_RED,"Nimate dovolj droge pri sebi.");
}
if(strcmp(option,"weed") == 0)
{
if(pInfo[playerid][Drugs] >= 11)
{
}
}
return 1;
}
forward Drugsoff(playerid);
public Drugsoff(playerid)
{
SetCameraBehindPlayer(playerid);
SetPlayerWeather(playerid, 2);
ClearAnimations(playerid);
return 1;
}
YCMD:usedrugs(playerid,params[],help)
{
new option[10];
if(sscanf(params,"s[10]",option)) return SendClientMessage(playerid,COLOR_WHITE,""blue""red"UPORABA:"white""white" /usedrugs [Option] | Options: heroin, ((weed))");
if(strcmp(option,"heroin") == 0)
{
if(pInfo[playerid][Drugs] >= 51)
{
new Floar:armour;
GetPlayerArmour(playerid, Float:armour);
SetPlayerArmour(playerid, Float:armour + 50);
pInfo[playerid][Drugs] = pInfo[playerid][Drugs] - 50;
GetPlayerArmour(playerid, Float:armour);
if(Float:armour >= 101) SetPlayerArmour(playerid, 100);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 0, 0, 0,0, 15000, 0);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerWeather(playerid, -66);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
SetTimerEx("Drugsoff", 15000, 0, "i", playerid);
for(new i; i < MAX_PLAYERS; i++)
if(IsPlayerInRangeOfPoint(i, 20.0, x,y,z))
{
new string[128];
format(string,sizeof(string),"* %s vzema heroin.",pName);
SendClientMessage(i,COLOR_ACTION,string);
}
}
else return SendClientMessage(playerid,COLOR_RED,"Nimate dovolj droge pri sebi.");
}
if(strcmp(option,"weed") == 0)
{
if(pInfo[playerid][Drugs] >= 11)
{
}
}
return 1;
}
forward Drugsoff(playerid);
public Drugsoff(playerid)
{
SetCameraBehindPlayer(playerid);
SetPlayerWeather(playerid, 2);
ClearAnimations(playerid);
return 1;
}
OnPlayerConnect(playerid)
{
pInfo[playerid][Drugs] = 100;
}
if(pInfo[playerid][Drugs] >= 51)
{
YCMD:usedrugs(playerid,params[],help)
{
new option[10];
if(sscanf(params,"s[10]",option)) return SendClientMessage(playerid,COLOR_WHITE,""blue""red"UPORABA:"white""white" /usedrugs [Option] | Options: heroin, ((weed))");
if(strcmp(option,"heroin") == 0)
{
new Floar:armour;
GetPlayerArmour(playerid, Float:armour);
SetPlayerArmour(playerid, Float:armour + 50);
GetPlayerArmour(playerid, Float:armour);
if(Float:armour >= 101) SetPlayerArmour(playerid, 100);
ClearAnimations(playerid);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 1, 1);
SetTimerEx("Drugsoff",15000,0,"i",playerid);
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerWeather(playerid, -66);
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
for(new i; i < MAX_PLAYERS; i++)
if(IsPlayerInRangeOfPoint(i, 20.0, x,y,z))
{
new string[128];
format(string,sizeof(string),"* %s vzema heroin.",pName);
SendClientMessage(i,COLOR_ACTION,string);
}
}
else return SendClientMessage(playerid,COLOR_RED,"Nimate dovolj droge pri sebi.");
}
if(strcmp(option,"weed") == 0)
{
}
return 1;
}
forward Drugsoff(playerid);
public Drugsoff(playerid)
{
SetCameraBehindPlayer(playerid);
SetPlayerWeather(playerid, 2);
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
return 1;
}
forward Drugsoff(playerid);
YCMD:usedrugs(playerid,params[],help)
{
new option[10];
if(sscanf(params,"s[10]",option)) return SendClientMessage(playerid,COLOR_WHITE,""blue""red"UPORABA:"white""white" /usedrugs [Option] | Options: heroin, ((weed))");
if(strcmp(option,"heroin") == 0)
{
new Floar:armour;
GetPlayerArmour(playerid, armour);
SetPlayerArmour(playerid, armour + 50);
GetPlayerArmour(playerid, armour);
if(armour >= 101) SetPlayerArmour(playerid, 100);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 1, 1);
SetTimerEx("Drugsoff",15000,0,"i",playerid);
}
else return SendClientMessage(playerid,COLOR_RED,"Nimate dovolj droge pri sebi.");
return 1;
}
public Drugsoff(playerid)
{
SetCameraBehindPlayer(playerid);
SetPlayerWeather(playerid, 2);
TogglePlayerControllable(playerid, 1);
ClearAnimations(playerid);
return 1;
}
|
Still when i first time type the command, the animation is not applyed, but second time is....
|