dcmd_invisible(playerid, cmdtext[]) { #pragma unused cmdtext if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be level 2 to become invisible"); SetPlayerPos(playerid,0.00,0.00,0.00); Invisible[playerid] = 1; SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are now invisible"); return 1; } dcmd_invisibleoff(playerid, cmdtext[]) { #pragma unused cmdtext if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You're not invisible!"); if(Invisible[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You're not invisible!"); Invisible[playerid] = 0; SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are now visible!"); return 1; public OnPlayerUpdate(playerid) { if(GetPlayerPing(playerid) >= 750) { [...] } if(GetPlayerWeapon(playerid) == 38) { [...] } if(Invisible[playerid])return 0; return 1; } }
dcmd_invisible(playerid, cmdtext[])
dcmd_invisible(playerid, params[])
Originally Posted by [HiC
TheKiller ]
pawn Код:
pawn Код:
|
Originally Posted by _Vortex
pawn Код:
|
if(Invisible[playerid])return 0;
return 1;
// invisible == 0
// not invisible == 1
OnPlayerUpdate(playerid)
{
return invisible; // would return 1 is he's not and 0 if he is.
}
dcmd_invisible(playerid, cmdtext[]) { #pragma unused cmdtext if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be level 2 to become invisible"); else SetPlayerPos(playerid,0.00,0.00,0.00); Invisible[playerid] = 1; SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are now invisible"); return 1; } dcmd_invisibleoff(playerid, cmdtext[]) { #pragma unused cmdtext if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You're not invisible!"); else if(Invisible[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You're not invisible!"); else Invisible[playerid] = 0; SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are now visible!"); return 1; public OnPlayerUpdate(playerid) { if(GetPlayerPing(playerid) >= 750) { [...] } if(GetPlayerWeapon(playerid) == 38) { [...] } if(Invisible[playerid])return 0; return 1; } }
Originally Posted by _Saif_
Код:
dcmd_invisible(playerid, cmdtext[]) { #pragma unused cmdtext if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be level 2 to become invisible"); else SetPlayerPos(playerid,0.00,0.00,0.00); Invisible[playerid] = 1; SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are now invisible"); return 1; } dcmd_invisibleoff(playerid, cmdtext[]) { #pragma unused cmdtext if(pInfo[playerid][Level] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You're not invisible!"); else if(Invisible[playerid] == 0) return SendClientMessage(playerid,COLOR_RED,"ERROR: You're not invisible!"); else Invisible[playerid] = 0; SendClientMessage(playerid,COLOR_LIGHTGREEN,"You are now visible!"); return 1; public OnPlayerUpdate(playerid) { if(GetPlayerPing(playerid) >= 750) { [...] } if(GetPlayerWeapon(playerid) == 38) { [...] } if(Invisible[playerid])return 0; return 1; } } |