Simple help please
#1

hey guys this is the function i am creating it.

pawn Код:
if(PlayerInfo[playerid][pAdminstrator] = 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!") && PlayerInfo[playerid][pAdminstrator] = 1;
and i got these errors:

C:\Users\Axme\Desktop\Freeroam server\gamemodes\Tw.pwn(620) : warning 211: possibly unintended assignment
C:\Users\Axme\Desktop\Freeroam server\gamemodes\Tw.pwn(620) : error 022: must be lvalue (non-constant)
C:\Users\Axme\Desktop\Freeroam server\gamemodes\Tw.pwn(620) : warning 215: expression has no effect
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.

620 error line is that one only.
Reply
#2

Try this.
pawn Код:
if(PlayerInfo[playerid][pAdminstrator] = 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!");
Reply
#3

No idea what are you doing with that
pawn Код:
if(PlayerInfo[playerid][pAdminstrator] == 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!");
You are setting the pAdminstrator to 1 after checking it. And the = must be two.
Reply
#4

This should do it.

Код:
if(PlayerInfo[playerid][pAdminLevel] == 1) return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!"); PlayerInfo[playerid][pAdminLevel] = 1;
Just take a close look to both codes and what you've done wrong.
Код:
if(PlayerInfo[playerid][pAdminstrator] == 1) //"=" Operator is INCORRECT, Must be "==".
//= Operator is to SET the value //== Operator is to CHECK if the value is true.
return SendClientMessage(playerid, 0x00FF00FF, "Welcome Back Server Adminstrator, Type /acmds to see your cmds!"); //";" Token is missing.
&& //this must be removed.
PlayerInfo[playerid][pAdminstrator] = 1;
An more detailed link:
https://sampwiki.blast.hk/wiki/Control_Structures#Operators



[EDIT:
Too late >_<.]
Reply
#5

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)