08.06.2013, 19:53
This is how I did it.
If player doesn't have a cellphone it'll give him message. If the power is already on, it'll say "Your phone is already on." and if it's not it'll set power = 1 and give message that "You have turned your phone's power on." and every phone command like /call /text will check if the phone is on or not as above. But I get following warning. Seeking an effective help!
Line 1691:
pawn Код:
// on top
new power;
//OnPlayerConnect
power = 0;
// Making command now
CMD:poweron(playerid,params[])
{
if(PlayerInfo[playerid][Cell]<=1)return SendClientMessage(playerid, COLOR_GREY, "You don't own a cellphone.");
if(power == 1){
SendClientMessage(playerid,COLOR_GREY,"Your phone is already on.");
}
else{
power == 1;
SendClientMessage(playerid,COLOR_WHITE,"You have turned your phone's power on.");
}
return 1;
}
Код:
C:\Users\*******\*******\******\gamemodes\*****.pwn(1691) : warning 215: expression has no effect Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 1 Warning.
Код:
power == 1;