Janchuks

[v1] In-Game plate changer.

Dec 22nd, 2012
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.36 KB | None | 0 0
  1. new szString[128], pVeh, Float:vPos[4];
  2.  
  3. CMD:buyplate( playerid, params[] ) //Using ZCMD.
  4. {
  5.     if( isnull( params ) )
  6.         return SendClientMessage( playerid, -1, "Syntax: /plate [plate(1-32 letters, car plate costs 50k)]" ); //If you are changing the plate price, change these two.
  7.  
  8.     if( strlen( params ) > 32 )
  9.         return SendClientMessage( playerid, -1, "Syntax: /plate [plate(1-32 letters), car plate costs 50k]" ); //If you are changing the plate price, change these two.
  10.  
  11.     if( !IsPlayerInAnyVehicle( playerid ) )
  12.         return SendClientMessage( playerid, -1, "Failed: You need to located in to your vehicle, car plate costs 50k" ); //If you are changing the plate price, change these two.
  13.  
  14.  
  15.     pVeh = GetPlayerVehicleID( playerid );
  16.  
  17.     format( v_Plate[pVeh], 32, "%s", params );
  18.     SetVehicleNumberPlate( pVeh, params );
  19.    
  20.         GetPlayerPos( playerid, vPos[0], vPos[1], vPos[2] );
  21.         GetVehicleZAngle( pVeh, vPos[3] );
  22.         SetVehicleToRespawn( pVeh );
  23.         SetVehiclePos( pVeh, vPos[0], vPos[1], vPos[2] );
  24.         SetVehicleZAngle( pVeh, vPos[3] );
  25.         PutPlayerInVehicle( playerid, pVeh, 0 );
  26.  
  27.     GivePlayerMoney(playerid, -50000);  //Remove this line if you want it for free. -Phantomz
  28.  
  29.     format( szString, 128, "Success: Your vehicle plate has succesfully changed to %s.", params );
  30.     SendClientMessage( playerid, -1, szString );
  31.  
  32.     return 1;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment