Setplate help
#1

Hello all.

I'm woundering how I can make a /setplate for VIP's only!

pDonateRank is what I got for VIP's in dini file

Any ways to make it ?

If you got a code I'll be happy as hell!

If tutorials I'll also be happy as hell!


Cheers
Reply
#2

Untested... Also this is without params, so you cannot get your own text, but you can change that.

pawn Код:
if (strcmp(cmdtext, "/setplate", true) == 0)
{
    new vehicleid;//Since it's not defined under OnPlayerCommandText
    vehicleid = GetPlayerVehicleID(playerid);//So that it actually gets the vehicleid
    if(pInfo[playerid][pDonateRank] < 1) return SendClientMessage(playerid, COLOR, "You're not a VIP");//I am guessing you are using pInfo
    SetVehicleNumberPlate(vehicleid, "Hi");//Setting the plate to "Hi"
    return 1;
}
Reply
#3

+ You'll need to respawn that vehicle for the changes to take effect.
Reply
#4

Thanks, let me see if it work

Edit: I got errors :S

Код:
C:\Program Files\Rockstar Games\GtaSa\SAMP\SERVER\gamemodes\rp.pwn(19679) : error 028: invalid subscript (not an array or too many subscripts): "pInfo"
C:\Program Files\Rockstar Games\GtaSa\SAMP\SERVER\gamemodes\rp.pwn(19679) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GtaSa\SAMP\SERVER\gamemodes\rp.pwn(19679) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GtaSa\SAMP\SERVER\gamemodes\rp.pwn(19679) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GtaSa\SAMP\SERVER\gamemodes\rp.pwn(19679) : fatal error 107: too many error messages on one line

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


4 Errors.
Help ?


These is what I got;

Код:
	if (strcmp(cmdtext, "/setplate", true) == 0)
	{
    	new vehicleid;//Since it's not defined under OnPlayerCommandText
    	vehicleid = GetPlayerVehicleID(playerid);//So that it actually gets the vehicleid
    	if(pInfo[playerid][pDonateRank] < 1) return SendClientMessage(playerid, COLOR, "You're not a VIP");//I am guessing you are using pInfo
    	SetVehicleNumberPlate(vehicleid, "I'm {7D0541} VIP");//Setting the plate to "Hi"
   		return 1;
	}
Reply
#5

Can you please tell me what player enum you use?

Is it like:
pawn Код:
pInfo[MAX_PLAYERS][pDonateRank]
or something else...?
Reply
#6

Sure its PlayerInfo
Reply
#7

enum pInfo I use
Like:

Код:
enum pInfo
{
	pKey[128],
	pLevel,
	pReportStyle,
	pAdmin,
	pBand,
	pPermBand,
	pWarns,
	pDisabled,
	pDonateRank,
Reply
#8

Try this:
pawn Код:
new vehicleid;
    vehicleid = GetPlayerVehicleID(playerid);
    if(PlayerInfo[playerid][pDonateRank] < 1) return SendClientMessage(playerid, 0xFF0000FF, "You're not a VIP");
    SetVehicleNumberPlate(vehicleid, "I'm {7D0541} VIP");
    return 1;
Reply
#9

Thanks!!!! It works!
Reply
#10

It should be:
pawn Код:
if (strcmp(cmdtext, "/setplate", true) == 0)
{
    if(PlayerInfo[playerid][pDonateRank] < 1) return SendClientMessage(playerid, -1, "You're not a VIP");
    SetVehicleNumberPlate(GetPlayerVehicleID(playerid), "{FF4040}VIP");
    SetVehicleToRespawn(GetPlayerVehicleID(playerid));
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)