/mycars help
#1

How can i make a cmd like /mycars that shows the player the cars he bought instead of seeing it in the /stats

Код:
		if (PlayerInfo[targetid][pPcarkey] != 9999)
		{
		    new vehiclename[24];
			GetVehicleName(carkey, vehiclename, sizeof(vehiclename));
		    format(coordsstring, sizeof(coordsstring), "| CarID: %d | Model: %s (%d) | VehValue: %d | VehColor1: %d | VehColor2: %d | VehLocked: %d | Code: %d |",carkey,vehiclename, CarInfo[carkey][cModel], GetVehiclePrice(carkey), CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock], CarInfo[carkey][cCode]);
		    SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
		}
		if (PlayerInfo[targetid][pPcarkey2] != 9999)
		{
		    new vehiclename[24];
			GetVehicleName(carkey2, vehiclename, sizeof(vehiclename));
		    format(coordsstring, sizeof(coordsstring), "| CarID: %d | Model: %s (%d) | VehValue: %d | VehColor1: %d | VehColor2: %d | VehLocked: %d | Code: %d |",carkey2,vehiclename, CarInfo[carkey2][cModel], GetVehiclePrice(carkey2), CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock], CarInfo[carkey2][cCode]);
		    SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
		}
	}
}
PS : GF larp edit
Reply
#2

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
For future reference Dan. Use this instead. Your code is unreadable.

This is available for you too...

Try this:
pawn Код:
if( !strcmp( cmdtext, "/mycars", true ) )
{
    if (PlayerInfo[targetid][pPcarkey] != 9999)
    {
        new vehiclename[24];
        GetVehicleName(carkey, vehiclename, sizeof(vehiclename));
        format(coordsstring, sizeof(coordsstring), "| CarID: %d | Model: %s (%d) | VehValue: %d | VehColor1: %d | VehColor2: %d | VehLocked: %d | Code: %d |",carkey,vehiclename, CarInfo[carkey][cModel], GetVehiclePrice(carkey), CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock], CarInfo[carkey][cCode]);
        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
    }
    if (PlayerInfo[targetid][pPcarkey2] != 9999)
    {
        new vehiclename[24];
        GetVehicleName(carkey2, vehiclename, sizeof(vehiclename));
        format(coordsstring, sizeof(coordsstring), "| CarID: %d | Model: %s (%d) | VehValue: %d | VehColor1: %d | VehColor2: %d | VehLocked: %d | Code: %d |",carkey2,vehiclename, CarInfo[carkey2][cModel], GetVehiclePrice(carkey2), CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock], CarInfo[carkey2][cCode]);
        SendClientMessage(playerid, COLOR_LIGHTBLUE,coordsstring);
    }
    return 1;
}
Reply
#3

Код:
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3463) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3492) : error 004: function "SafeGivePlayerMoney" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3838) : error 004: function "SafeSetPlayerInterior" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3881) : error 017: undefined symbol "GetVehicleName"
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3881) : warning 202: number of arguments does not match definition
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3897) : error 004: function "IsASalesVehicle" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3901) : error 004: function "GetVehiclePrice" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(3996) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(4001) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(4006) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(4011) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(4016) : error 004: function "SafeSetPlayerPos" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(4826) : error 004: function "ABroadCast" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(4828) : error 004: function "ABroadCast" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(5626) : error 004: function "ClearChatbox" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(5644) : error 004: function "SendAdminMessage" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(5649) : error 004: function "OnPlayerUpdateEx" is not implemented
C:\Users\Viddo\Desktop\LARP 4.0\LARP 4.0 D\gamemodes\larp.pwn(5671) : error 004: function "SendAdminMessage" is not implemented
Reply
#4

You have forgotted a }
Reply
#5

Where ?
Reply
#6

Put after every callback( one at the time ), #endinput and you'll find it...
Reply
#7

Quote:
Originally Posted by aRoach
Посмотреть сообщение
Put after every callback( one at the time ), #endinput and you'll find it...
Yes but those errors came after i added this cmd and i cant find a missed } in the cmd
Reply
#8

If you delete the command, the errors persist ?
Reply
#9

no it compiles normally
Reply
#10

Put again the command but this time put it at the top of the OnPlayerCommandText.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)