other players cant see special action - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: other players cant see special action (
/showthread.php?tid=571751)
other players cant see special action -
PSYCHOBABYKILLA - 21.04.2015
well i use this special action
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMO KE_CIGGY);
i always test everything on 2 computers to make sure it works and i can that you cannot see the player smoking on the other computer but when im smoking i can see it on my screen
Re: other players cant see special action -
Jimmy0wns - 21.04.2015
Where exactly did you put this?
Re: other players cant see special action -
Sithis - 21.04.2015
Please show your code, that way we can help you.
Re: other players cant see special action -
PSYCHOBABYKILLA - 21.04.2015
Код:
dcmd_takedrugs(playerid, params[])
{
if (PlayerInfo[playerid][pSpawn] == 1){
if (PlayerInfo[playerid][pTeam] == TEAM_CIVILIAN && PlayerInfo[playerid][pVigilante] == 0){
new idx,amount,string[256],tmp[256];
tmp = strtok(params, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_ERROR, "USAGE: /takedrugs (qty).");
return 1;
}
if(!isNumeric(tmp))
{
SendClientMessage(playerid, COLOR_ERROR, "Invalid Amount.");
return 1;
}
amount = strval(tmp);
if (PlayerInfo[playerid][pDrugs] < amount)
{
format(string, sizeof(string), "You Do Not Have Enough Drugs. You Are Carrying %d Grams Of Drugs.",PlayerInfo[playerid][pDrugs]);
SendClientMessage(playerid,COLOR_ERROR, string);
return 1;
}
if (amount < 1 || amount > 200)
{
format(string, sizeof(string), "Invalid Drug Quantity. Enter an Amount of Grams of Drugs to Take Between 1 and 200. (Carrying %d Grams)",PlayerInfo[playerid][pDrugs]);
SendClientMessage(playerid, COLOR_ERROR, string);
return 1;
}
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_SMOKE_CIGGY);
PlayerInfo[playerid][pDrugs] -= amount;
PlayerInfo[playerid][pDrugTime] = amount * 10;
SendClientMessage(playerid,COLOR_SERVER_HELP_MSG, "You Are On Drugs. Your Health Will Refill Automatically.");
GameTextForPlayer(playerid,"~w~ON DRUGS",5000,3);
if (IsSuspectInRangeOfPolice(playerid) && PlayerInfo[playerid][pJailed] == 0)
{
format(string, sizeof(string), "Crime: Drug Consumption");
ReportCrimeTOPolice(playerid,string);
PlayerInfo[playerid][pWantedLevel] ++;
}
SetPlayerWantedStats(playerid,"Drug Consumption");
}else{
SendClientMessage(playerid, COLOR_ERROR, "Law Enforcement Agents Cannot Take Drugs.");
}
}else{
SendClientMessage(playerid, COLOR_ERROR, "You Cannot Use This Command When You're Dead.");
}
return 1;
}