14.08.2013, 19:59
Hey guys today i'm going to show u how to make personal cars
Step 1 : Create a new pawno file and delete all content xDStep 2 : Add at the top
Code:
#include <a_samp>
Code:
new privatecars;
Code:
#include <a_samp> new privatecars;
Template :
Code:
privatecars = AddStaticVehicle(vmodel, Float X, Float Y, Float Z, Rotation, Colour 1, Colour 2)
Code:
privatecars = AddStaticVehicle(411, 248.2920000, -1801.4291000, 4.4594000, 0.0000000, 3, 3)
Code:
public OnGameModeInit() { privatecars = AddStaticVehicle(411, 248.2920000, -1801.4291000, 4.4594000, 0.0000000, 3, 3) return 1; }
Step 5 : Now Move to public OnPlayerStateChange()
Step 6 : Write this :
Code:
1)public OnPlayerStateChange(playerid, newstate, oldstate) 2){ 3) if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == privatecars) 4) { 5) new name[MAX_PLAYER_NAME]; 6) GetPlayerName(playerid, name, sizeof(name)); 7) if(strcmp(name, "", false)) 8) { 9) RemovePlayerFromVehicle(playerid); 10) SendClientMessage(playerid, 0x281aeb, "This vehicle doesn't belong to "); 11) } 12) } 13) return 1; }
Code:
public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == privatecars) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(strcmp(name, "1Geek", false)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, 0x281aeb, "This vehicle doesn't belong to 1Geek"); } } return 1; }
Code:
#include <a_samp> new privatecars; public OnGameModeInit() { privatecars = AddStaticVehicle(411, 248.2920000, -1801.4291000, 4.4594000, 0.0000000, 3, 3); return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(newstate == PLAYER_STATE_DRIVER && GetPlayerVehicleID(playerid) == privatecars) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(strcmp(name, "Bizza", false)) { RemovePlayerFromVehicle(playerid); SendClientMessage(playerid, 0x281aeb, "This vehicle doesn't belong to you"); } } return 1; }
// You can make a teleport to this car >>
Write this @ OnPlayerCommandText
Code:
public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/pcar1", true)) { SetPlayerPos(playerid, 248.2920000, -1801.4291000, 4.4594000); return 1; } return 0; }
Hope i helped more than one