Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new bool:SmokeIsOn[MAX_PLAYERS] = false;
- new SmokeObject[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && SmokeIsOn[i]){
- StopPlayerHoldingObject(i);
- }
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(!strcmp(cmdtext, "/smoke", true))
- {
- new Float:pX, Float:pY, Float:pZ;
- if(!SmokeIsOn[playerid]){
- SmokeIsOn[playerid] = true;
- GetPlayerPos(playerid, pX, pY, pZ);
- SmokeObject[playerid] = SetPlayerHoldingObject(playerid, 2780, 10);
- }
- else{
- SmokeIsOn[playerid] = false;
- StopPlayerHoldingObject(playerid);
- SmokeObject[playerid] = (-1);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement