Help Urgent
#1

Код:
	if(strcmp(cmd, "/rank", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
		   {
				SendClientMessage(playerid, COLOR_ALLDEPT, "Use /rank [id]");
				return 1;
		   }
		   if (giveplayerid == INVALID_PLAYER_ID)
	    {
		    SendClientMessage(playerid, COLOR_ALLDEPT, "Player is not connected");
		    return 1;
	     }
		   GetPlayerName(playerid, sendername, sizeof(sendername));
		   GetPlayerName(targetid, name, sizeof(name));
		   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			 if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
			 {
          new currank[64];
          new string[128];
          if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
          else if(PlayerInfo[playerid][pRank] == 2) { currank = "Officer"; }
          else if(PlayerInfo[playerid][pRank] == 3) { currank = "Senior Officer"; }
          else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
          else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
          else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
          else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
          else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; }
          else { currank = "Cadet"; }
          format(string, sizeof(string), "%d SAPD Rank Is %s", targetid, currank);
          SendClientMessage(playerid,COLOR_GREEN1337, string);
				  SendClientMessage(playerid,COLOR_GREEN1337,"Has normal rights when on duty");
          }
	    else
	    {
			  SendClientMessage(playerid, COLOR_ALLDEPT, "You are not a cop");
	    }
		}
		return 1;
	}


What is wronge with this ?
Reply
#2

Do you get any errors, if so put them
Reply
#3

Код:
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(6758) : warning 219: local variable "newstate" shadows a variable at a preceding level
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(6758) : warning 219: local variable "oldstate" shadows a variable at a preceding level
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(7885) : warning 204: symbol is assigned a value that is never used: "plname"
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(7884) : warning 204: symbol is assigned a value that is never used: "maxspeed"
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(20964) : error 017: undefined symbol "targetid"
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(20964) : error 017: undefined symbol "name"
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(20964) : error 029: invalid expression, assumed zero
C:\Users\Sam\Desktop\NewScripts\gamemodes\12345678.pwn(20964) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#4

Quote:
Originally Posted by Aang
Код:
	if(strcmp(cmd, "/rank", true) == 0)
	{
		if(IsPlayerConnected(playerid))
		{
		    tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
		   {
				SendClientMessage(playerid, COLOR_ALLDEPT, "Use /rank [id]");
				return 1;
		   }
		   if (giveplayerid == INVALID_PLAYER_ID)
	    {
		    SendClientMessage(playerid, COLOR_ALLDEPT, "Player is not connected");
		    return 1;
	     }
		   GetPlayerName(playerid, sendername, sizeof(sendername));
		   GetPlayerName(targetid, name, sizeof(name));
		   GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			 if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
			 {
          new currank[64];
          new string[128];
          if(PlayerInfo[playerid][pRank] == 1) { currank = "Cadet"; }
          else if(PlayerInfo[playerid][pRank] == 2) { currank = "Officer"; }
          else if(PlayerInfo[playerid][pRank] == 3) { currank = "Senior Officer"; }
          else if(PlayerInfo[playerid][pRank] == 4) { currank = "Sergeant"; }
          else if(PlayerInfo[playerid][pRank] == 5) { currank = "Lieutenant"; }
          else if(PlayerInfo[playerid][pRank] == 6) { currank = "Captain"; }
          else if(PlayerInfo[playerid][pRank] == 7) { currank = "Deputy Chief"; }
          else if(PlayerInfo[playerid][pRank] == 8) { currank = "Chief"; }
          else { currank = "Cadet"; }
          format(string, sizeof(string), "%d SAPD Rank Is %s", targetid, currank);
          SendClientMessage(playerid,COLOR_GREEN1337, string);
				  SendClientMessage(playerid,COLOR_GREEN1337,"Has normal rights when on duty");
          }
	    else
	    {
			  SendClientMessage(playerid, COLOR_ALLDEPT, "You are not a cop");
	    }
		}
		return 1;
	}


What is wronge with this ?
pawn Код:
if(strcmp(cmd, "/rank", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
       tmp = strtok(cmdtext, idx);
           if(!strlen(tmp))
           {
                SendClientMessage(playerid, COLOR_ALLDEPT, "Use /rank [id]");
                return 1;
           }
           new pid = strval(tmp);
           if (!IsPlayerConnected(pid))
       {
            SendClientMessage(playerid, COLOR_ALLDEPT, "Player is not connected");
            return 1;
         }
         new TargetName[MAX_PLAYER_NAME];
           GetPlayerName(playerid, sendername, sizeof(sendername));
           GetPlayerName(pid, TargetName, sizeof(TargetName));
             if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
             {
          new currank[64];
          new string[128];
          if(PlayerInfo[pid][pRank] == 1) { currank = "Cadet"; }
          else if(PlayerInfo[pid][pRank] == 2) { currank = "Officer"; }
          else if(PlayerInfo[pid][pRank] == 3) { currank = "Senior Officer"; }
          else if(PlayerInfo[pid][pRank] == 4) { currank = "Sergeant"; }
          else if(PlayerInfo[pid][pRank] == 5) { currank = "Lieutenant"; }
          else if(PlayerInfo[pid][pRank] == 6) { currank = "Captain"; }
          else if(PlayerInfo[pid][pRank] == 7) { currank = "Deputy Chief"; }
          else if(PlayerInfo[pid][pRank] == 8) { currank = "Chief"; }
          else { currank = "Cadet"; }
          format(string, sizeof(string), "%d SAPD Rank Is %s", pid, currank);
          SendClientMessage(playerid,COLOR_GREEN1337, string);
                  SendClientMessage(playerid,COLOR_GREEN1337,"Has normal rights when on duty");
          }
        else
        {
              SendClientMessage(playerid, COLOR_ALLDEPT, "You are not a cop");
        }
        }
        return 1;
    }
Try this.
Reply
#5

I try it InGame but comes back with this


I type
/rank 1 ( id 1 is me IG )
Says "Player isnt connected"
Reply
#6

Quote:
Originally Posted by Aang
I try it InGame but comes back with this


I type
/rank 1 ( id 1 is me IG )
Says "Player isnt connected"
Copy the code again.. i just edited it
Reply
#7

okay let me try it
Reply
#8

Well it works but , Still isnt working right

When i type in /rank 0

0 SAPD Rank is Cheif
Has normal rights on duty


my id ig is 1 my rank is Cheif

Id 0 rank is Captain ?
Reply
#9

Still nothing ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)