SA-MP Forums Archive
/mycars help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /mycars help (/showthread.php?tid=319513)



/mycars help - viddo - 19.02.2012

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


Re: /mycars help - aRoach - 19.02.2012

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;
}



Re: /mycars help - viddo - 19.02.2012

Код:
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



Re: /mycars help - aRoach - 19.02.2012

You have forgotted a }


Re: /mycars help - viddo - 19.02.2012

Where ?


Re: /mycars help - aRoach - 19.02.2012

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


Re: /mycars help - viddo - 19.02.2012

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


Re: /mycars help - aRoach - 19.02.2012

If you delete the command, the errors persist ?


Re: /mycars help - viddo - 19.02.2012

no it compiles normally


Re: /mycars help - aRoach - 19.02.2012

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