help with "if"
#1

I got this

#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pInfo[playerid][superadmin] == 0)) return SendClientMessage(playerid, COLOR_YELLOW, "You are not in Super Admin Mode.");
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_JUMP))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z + 10.0);
}
return 1;
}
COMMANDuperadmin(playerid, params[])
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, "You are not an Rcon Admin.");
pInfo[playerid][superadmin] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "You are now in Super Admin Mode.");
return 1;
}

error 029: invalid expression, assumed zero
warning 215: expression has no effect
error 001: expected token: ";", but found "return"

All on the "if(pInfo[playerid] etc line

There is something i do wrong with thorse if's after each other i think, but i don't know how i should set them up.
Reply
#2

pawn Код:
if(pInfo[playerid][superadmin] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You are not in Super Admin Mode."); //had one too many )'s
You had one too many )'s at the end of the if statement.
Reply
#3

pawn Код:
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(pInfo[playerid][superadmin] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You are not in Super Admin Mode.");
if(IsPlayerAdmin(playerid))
if (PRESSED(KEY_JUMP))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z + 10.0);
}
return 1;
}
CMD:superadmin(playerid, params[])
{
if(IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_YELLOW, "You are not an Rcon Admin.");
pInfo[playerid][superadmin] = 1;
SendClientMessage(playerid, COLOR_YELLOW, "You are now in Super Admin Mode.");
return 1;
}
Reply
#4

Quote:
Originally Posted by CentyPoo
Посмотреть сообщение
pawn Код:
if(pInfo[playerid][superadmin] == 0) return SendClientMessage(playerid, COLOR_YELLOW, "You are not in Super Admin Mode."); //had one too many )'s
You had one too many )'s at the end of the if statement.
Haha, thanks, God.. should have known that xD
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)