A bit of help would be nice
#1

now i have converted half of my comments it used to be DCMD but now its ZCMD i cant seem to find out whats this error mean any ideas peeps

(32245) : error 017: undefined symbol "giveplayerid"
(32247) : error 017: undefined symbol "sendername"



Код:
CMD:extortion(playerid, params[])
		{
	    if(IsPlayerConnected(playerid))
		{
		    new string[128];
		    new businesstype[128];
      		new tmp[128], idx, cmd[128];
			new id = PlayerInfo[playerid][pPbiskey];
			format( string, sizeof( string ), "Businesses/Business_%d.ini", id);
        	if(!dini_Exists(string))
        	{
        	    SendClientMessage( playerid, COLOR_GREY, "   You don't own a Business!" );
            	return 1;
        	}
			tmp = strtok(params, idx);
			if(!strlen(tmp))
			{
			    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /extortion [PlayerID/PartOfName] (or 555 for Nobody)");
			    return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerConnected(giveplayerid))
			{
			    if(giveplayerid != INVALID_PLAYER_ID)
			    {
			        GetPlayerName(playerid, sendername, sizeof(sendername));
			        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
			        format(string, sizeof(string), "* %s is know Extortioning your Business.",giveplayer);
			        SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
			        format(string, sizeof(string), "* %s has adjusted his Business, you are now Extortioning his Business.",sendername);
			        SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
					format(string, sizeof(string), "%s",giveplayer);
					strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255);
					format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]);
     				SaveBusiness(id);
					SendClientMessage(playerid, COLOR_WHITE, string);
			    }
			}
			else if(giveplayerid == 555)
			{
				format(string, sizeof(string), "Nobody");
				strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255);
				format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]);
				SaveBusiness(id);
				SendClientMessage(playerid, COLOR_WHITE, string);
			}
			else
			{
			    SendClientMessage(playerid, COLOR_GREY, "Invalid ID!");
			    return 1;
			}
		}
		return 1;
	}
Reply
#2

At these variables above the if(IsPlayerConnected(playerid)).

pawn Код:
new giverplayerid = INVALID_PLAYER_ID;
new sendername[MAX_PLAYER_NAME];
Reply
#3

done it but didnt work
Reply
#4

Quote:
Originally Posted by Yves
Посмотреть сообщение
done it but didnt work
Apparently, I'm a normal human being so can't read minds. Mind explaining what the problem is?

Edit: Show your edited code.
Reply
#5

this line here is coming up the error giveplayerid = ReturnUser(tmp);

and same with this one
GetPlayerName(playerid, sendername, sizeof(sendername));
Reply
#6

Quote:
Originally Posted by Yves
Посмотреть сообщение
this line here is coming up the error giveplayerid = ReturnUser(tmp);

and same with this one
GetPlayerName(playerid, sendername, sizeof(sendername));
Alright, let's do it this way. Show me your edited command as well as your compiler error.
Reply
#7

CMD:extortion(playerid, params[])


witch is on the top i have edited?


same with the errors Also them to thingy still comes up as the same errors
Reply
#8

YO!

First error... RENAME ALL giveplayerid to playerid

And then re-compile tell me if that takes the error away please
Reply
#9

pawn Код:
CMD:extortion(playerid, params[])
{
        if(IsPlayerConnected(playerid))
        {
            new string[128];
            //new businesstype[128]; what is this ?
            new giveplayerid ;
            new  Index, tmp[256]; //idx shoule be Index in zcmd
            new id = PlayerInfo[playerid][pPbiskey];
            format( string, sizeof( string ), "Businesses/Business_%d.ini", id);
            if(!dini_Exists(string))
            {
                SendClientMessage( playerid, COLOR_GREY, "   You don't own a Business!" );
                return 1;
            }
            tmp  = strtok(params,Index);
            if(isnull(tmp)) // should be isnull in ZCMD
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /extortion [PlayerID/PartOfName] (or 555 for Nobody)");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            if(IsPlayerConnected(giveplayerid))
            {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                    new sendername[MAX_PLAYER_NAME];
                    new giveplayer[MAX_PLAYER_NAME];
                    GetPlayerName(playerid, sendername, sizeof(sendername));
                    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
                    format(string, sizeof(string), "* %s is know Extortioning your Business.",giveplayer);
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "* %s has adjusted his Business, you are now Extortioning his Business.",sendername);
                    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
                    format(string, sizeof(string), "%s",giveplayer);
                    strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255);
                    format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]);
                    SaveBusiness(id);
                    SendClientMessage(playerid, COLOR_WHITE, string);
                }
            }
            else if(giveplayerid == 555)
            {
                format(string, sizeof(string), "Nobody");
                strmid(BizzInfo[id][bExtortion], string, 0, sizeof(string), 255);
                format(string, sizeof(string), "Business Extortion Name set to %s",BizzInfo[id][bExtortion]);
                SaveBusiness(id);
                SendClientMessage(playerid, COLOR_WHITE, string);
            }
            else
            {
                SendClientMessage(playerid, COLOR_GREY, "Invalid ID!");
                return 1;
            }
        }
        return 1;
}
Reply
#10

Well you need to use that SenderName . Remove it just %s this function will automaticly take the specific person name
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)