Whats wrong with this?
#1

Whats wrong with this-

Код:
  format(string, sizeof(string),".:BLA BLA BLA %d!:.",VehicleInfo[car][CarOwner]);
	    SendClientMessage(playerid,0xFFFFFFFF,VehicleInfo[car][CarOwner]);
errors-
Код:
 error 029: invalid expression, assumed zero
error 017: undefined symbol "string"
error 017: undefined symbol "string"
Reply
#2

put new string[56];
Reply
#3

Thanks, but do you know why when i go in the car it doesnt send the message?
Reply
#4

Quote:
Originally Posted by DevilRP
Thanks, but do you know why when i go in the car it doesnt send the message?
IDK, post the whole message here
Reply
#5

here-
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{new stringg[56];
	if(GetPlayerVehicleID(playerid) >= VCount) return 1;
	new car = GetPlayerVehicleID(playerid); 

	if(newstate==PLAYER_STATE_DRIVER)
	{
		new PlayerName[100]; GetPlayerName(playerid,PlayerName,30);
		if(VehicleInfo[car][CarOwned] == 1)
		{
      if(strcmp(PlayerName,VehicleInfo[car][CarOwner],true) == 0) {
   format(stringg, sizeof(stringg),".:!blabla:.");
	    SendClientMessage(playerid,0xFFFFFFFF,"");
      } else {
     format(stringg, sizeof(stringg),".:!%s blabla:.");
	    SendClientMessage(playerid,0xFFFFFFFF,VehicleInfo[car][CarOwner]);    }
		}
		else if(VehicleInfo[car][Buyable] == 0)
		{
    format(stringg, sizeof(stringg),".:blabla:.",VehicleInfo[car][CarOwner]);
	    SendClientMessage(playerid,0xFFFFFFFF,VehicleInfo[car][CarOwner]);
		}
		else
		{
    format(stringg, sizeof(stringg),".:!%d blabla:.",VehicleInfo[car][CarOwner]);
	    SendClientMessage(playerid,0xFFFFFFFF,VehicleInfo[car][CarOwner]);
		}
 	}

	if(newstate==PLAYER_STATE_PASSENGER)
	{
		if(VehicleInfo[car][CarOwned] == 1)
		{
    format(stringg, sizeof(stringg),".:!%s blabla:.",VehicleInfo[car][CarOwner]);
	    SendClientMessage(playerid,0xFFFFFFFF,VehicleInfo[car][CarOwner]);
		}
	}

	return 1;
}
Reply
#6

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    new stringg[56];
    if(GetPlayerVehicleID(playerid) >= VCount) return 1;
    new car = GetPlayerVehicleID(playerid);
    if(newstate==PLAYER_STATE_DRIVER)
    {
        new PlayerName[100]; GetPlayerName(playerid,PlayerName,30);
        if(VehicleInfo[car][CarOwned] == 1)
        {
            if(strcmp(PlayerName,VehicleInfo[car][CarOwner],true) == 0)
            {
                format(stringg, sizeof(stringg),".:!blabla:.");
                SendClientMessage(playerid,0xFFFFFFFF,stringg);
            }
            else
            {
                format(stringg, sizeof(stringg),".:!%s blabla:.");
                SendClientMessage(playerid,0xFFFFFFFF,stringg);
            }
        }
        else if(VehicleInfo[car][Buyable] == 0)
        {
            format(stringg, sizeof(stringg),".:blabla:.",VehicleInfo[car][CarOwner]);
            SendClientMessage(playerid,0xFFFFFFFF,stringg);
        }
        else
        {
            format(stringg, sizeof(stringg),".:!%d blabla:.",VehicleInfo[car][CarOwner]);
            SendClientMessage(playerid,0xFFFFFFFF,stringg);
        }
    }
    if(newstate==PLAYER_STATE_PASSENGER)
    {
        if(VehicleInfo[car][CarOwned] == 1)
        {
            format(stringg, sizeof(stringg),".:!%s blabla:.",VehicleInfo[car][CarOwner]);
            SendClientMessage(playerid,0xFFFFFFFF,stringg);
        }
    }
    return 1;
}
Reply
#7

Thanks, it sends the message now but for example
when i want it to say the name of the player who owns the vehicle it doesnt say it + it doesnt say the price of the vehicle it says "110 blablabla"
Reply
#8

else if(VehicleInfo[car][Buyable] == 0)
{
format(stringg, sizeof(stringg),".:Price: %d blabla:.",VehicleInfo[car][CarPrice?]);
SendClientMessage(playerid,0xFFFFFFFF,stringg);
}
Reply
#9

Ok, i tryed to do it but when i go in the vehicle it doesnt say the price of the vehicle or its owner..
so here it is as gametext, can you make it into a clientmessage?
the price and owner works as gametext but when i tryed to make it clientmessage it didnt show it like that
here it is as gametext-
Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
	if(GetPlayerVehicleID(playerid) >= VCount) return 1;
	new car = GetPlayerVehicleID(playerid);   new msg[256];

	if(newstate==PLAYER_STATE_DRIVER)
	{
		new PlayerName[100]; GetPlayerName(playerid,PlayerName,30);
		if(VehicleInfo[car][CarOwned] == 1)
		{
      if(strcmp(PlayerName,VehicleInfo[car][CarOwner],true) == 0) {
      GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This is your vehicle",2000,3);
      } else {
			format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This vehicle belongs to %s", VehicleInfo[car][CarOwner] );
		  GameTextForPlayer(playerid,msg,2000,3); }
		}
		else if(VehicleInfo[car][Buyable] == 0)
		{
		format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This vehicle is not for sell", VehicleInfo[car][CarOwner] );
		GameTextForPlayer(playerid,msg,2000,3);
		}
		else
		{
		format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This car is for sell Price $%d",VehicleInfo[car][Price]);
    GameTextForPlayer(playerid,msg,2000,3);
		}
 	}

	if(newstate==PLAYER_STATE_PASSENGER)
	{
		if(VehicleInfo[car][CarOwned] == 1)
		{
		format(msg,sizeof(msg),"~n~~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~This vehicle belongs to %s", VehicleInfo[car][CarOwner] );
	  GameTextForPlayer(playerid,msg,2000,3);
		}
	}

	return 1;
}
Reply
#10

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(GetPlayerVehicleID(playerid) >= VCount) return 1;
    new car = GetPlayerVehicleID(playerid), msg[256];

    if(newstate==PLAYER_STATE_DRIVER)
    {
        new PlayerName[100]; GetPlayerName(playerid,PlayerName,30);
        if(VehicleInfo[car][CarOwned] == 1)
        {
            if(strcmp(PlayerName,VehicleInfo[car][CarOwner],true) == 0)
            {
                SendClientMessage(playerid,0xFFFFFFFF,"This is your vehicle");
            }
            else
            {
                format(msg,sizeof(msg),"This vehicle belongs to %s", VehicleInfo[car][CarOwner] );
                SendClientMessage(playerid,0xFFFFFFFF,msg);
            }
            else if(VehicleInfo[car][Buyable] == 0)
            {
                format(msg,sizeof(msg),"This vehicle is not for sell", VehicleInfo[car][CarOwner] );
                SendClientMessage(playerid,0xFFFFFFFF,msg);
            }
            else
            {
                format(msg,sizeof(msg),"This car is for sell Price $%d",VehicleInfo[car][Price]);
                SendClientMessage(playerid,0xFFFFFFFF,msg);
            }
        }
        if(newstate==PLAYER_STATE_PASSENGER)
        {
            if(VehicleInfo[car][CarOwned] == 1)
            {
                format(msg,sizeof(msg),"This vehicle belongs to %s", VehicleInfo[car][CarOwner] );
                SendClientMessage(playerid,0xFFFFFFFF,msg);
            }
        }
        return 1;
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)