SA-MP Forums Archive
Looking for help with Setting plate - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Server (https://sampforum.blast.hk/forumdisplay.php?fid=6)
+--- Forum: Server Support (https://sampforum.blast.hk/forumdisplay.php?fid=19)
+--- Thread: Looking for help with Setting plate (/showthread.php?tid=453912)



Looking for help with Setting plate - amitdahari - 26.07.2013

i have zcmd can anyone help me find out how to install plate to players cars?


Re: Looking for help with Setting plate - AdamCooper - 26.07.2013

Hi
Use SetVehicleNumberPlate


Re: Looking for help with Setting plate - Beaner - 27.07.2013

https://sampwiki.blast.hk/wiki/SetVehicleNumberPlate

I don't think ****** is that hard to use, or is it .. !!


Re: Looking for help with Setting plate - DJ_Shocker - 27.07.2013

Quote:
Originally Posted by Beaner
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/SetVehicleNumberPlate

I don't think ****** is that hard to use, or is it .. !!
lol true. It takes less time to use ******, than it is to post a topic here and wait for a response.


Re: Looking for help with Setting plate - amitdahari - 27.07.2013

Well. True But i got this Cmd :
Quote:

#include a_samp
#include zcmd
#include sscanf2

/* ==== */
/* FS:Plate is a filterscript made by Marricio. */
/* ==== */

new v_Plate[MAX_VEHICLES][32];

CMDlate( playerid, params[] )
{
if( isnull( params ) )
return SendClientMessage( playerid, -1, "Syntax: /plate [plate(1-32 letters)]" );

if( strlen( params ) > 32 )
return SendClientMessage( playerid, -1, "Syntax: /plate [plate(1-32 letters)]" );

if( !IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "Error: You need to be in a vehicle." );


new szString[128], pVeh, Float:vPos[4];
pVeh = GetPlayerVehicleID( playerid );

format( v_Plate[pVeh], 32, "%s", params );
SetVehicleNumberPlate( pVeh, params );

GetPlayerPos( playerid, vPos[0], vPos[1], vPos[2] );
GetVehicleZAngle( pVeh, vPos[3] );
SetVehicleToRespawn( pVeh );
SetVehiclePos( pVeh, vPos[0], vPos[1], vPos[2] );
SetVehicleZAngle( pVeh, vPos[3] );
PutPlayerInVehicle( playerid, pVeh, 0 );

format( szString, 128, "Your vehicle plate has succesfully changed to %s.", params );
SendClientMessage( playerid, -1, szString );

return 1;
}

CMDetplate( playerid, params[] )
{
new iVictim, szPlate[32];
if( sscanf( params, "us[32]", iVictim, szPlate ) )
return SendClientMessage( playerid, -1, "Syntax: /plate [playerid][plate(1-32 letters)]" );

if( strlen( szPlate ) > 32 )
return SendClientMessage( playerid, -1, "Syntax: /plate [playerid][plate(1-32 letters)]" );

if( !IsPlayerAdmin( playerid ) )
return SendClientMessage( playerid, -1, "Error: You're not an administrator." );

if( !IsPlayerConnected( iVictim ) )
return SendClientMessage( playerid, -1, "Error: That player isn't connected." );

if( !IsPlayerInAnyVehicle( iVictim ) )
return SendClientMessage( playerid, -1, "Error: That player isn't in a vehicle." );

new szString[128], pVeh, Float:vPos[4];
pVeh = GetPlayerVehicleID( iVictim );

format( v_Plate[pVeh], 32, "%s", szPlate );
SetVehicleNumberPlate( pVeh, szPlate );

GetPlayerPos( iVictim, vPos[0], vPos[1], vPos[2] );
GetVehicleZAngle( pVeh, vPos[3] );
SetVehicleToRespawn( pVeh );
SetVehiclePos( pVeh, vPos[0], vPos[1], vPos[2] );
SetVehicleZAngle( pVeh, vPos[3] );
PutPlayerInVehicle( iVictim, pVeh, 0 );

format( szString, 128, "An administrator set your vehicle plate to %s.", szPlate );
SendClientMessage( playerid, -1, szString );

return 1;
}

CMD:getplate( playerid, params[] )
{
if( isnull( params ) )
return SendClientMessage( playerid, -1, "Syntax: /getplate [vehicleid]" );

new szString[128];
format( szString, 128, "[ VEHICLE ID: %d | PLATE: %s ]", strval( params ), v_Plate[strval( params )] );
SendClientMessage( playerid, -1, szString );

return 1;
}

But how can i make it that only Admins could make plates

(In this cmd everyone can make plates.)


Re: Looking for help with Setting plate - Sublime - 27.07.2013

if(IsPlayerAdmin)


Re: Looking for help with Setting plate - CAC - 27.07.2013

Quote:
Originally Posted by Sublime
Посмотреть сообщение
if(IsPlayerAdmin)
^

This.


Re: Looking for help with Setting plate - amitdahari - 27.07.2013

I can't understand..
Usually in my script it goes like..:
Quote:

if(PlayerInfo[playerid][pAdmin] >=1)