Setplate 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Setplate help (
/showthread.php?tid=239373)
Setplate help -
Meinstad - 13.03.2011
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
Re: Setplate help -
alpha500delta - 13.03.2011
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;
}
Re: Setplate help -
xRyder - 13.03.2011
+ You'll need to respawn that vehicle for the changes to take effect.
Re: Setplate help -
Meinstad - 13.03.2011
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;
}
Re: Setplate help -
xRyder - 13.03.2011
Can you please tell me what player enum you use?
Is it like:
pawn Код:
pInfo[MAX_PLAYERS][pDonateRank]
or something else...?
Re: Setplate help -
Hashski - 13.03.2011
Sure its PlayerInfo
Re: Setplate help -
Meinstad - 13.03.2011
enum pInfo I use
Like:
Код:
enum pInfo
{
pKey[128],
pLevel,
pReportStyle,
pAdmin,
pBand,
pPermBand,
pWarns,
pDisabled,
pDonateRank,
Re: Setplate help -
xRyder - 13.03.2011
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;
Re: Setplate help -
Meinstad - 13.03.2011
Thanks!!!! It works!
Re: Setplate help -
HyperZ - 13.03.2011
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;
}