28.07.2009, 16:38
very simple,I'll write you an example.
for example you want to spawn an infernus ;
forward it
forward Spawncar(playerid,model);
make a variable;
new Spawncar[MAX_PLAYERS];
Command
if(strcmp(cmd, "/infernus", true) == 0) {
Spawncar(playerid,411);
return 1;}
some example;
public Spawncar(playerid,model){
new Float;new Float:y;new Float:z;
GetPlayerPos(playerid, x, y, z);
new string[256];
if(IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid, COLOR_RED, "You have alvredy a vehicle!");
}else{
if(Spawncar[playerid]==0){
Spawcar[playerid]=CarSpawnLimit;
new vehicleid=CreateVehicle(model, x+3, y, z, 900.00, -1, -1, -1);
}
just an example.
Ecko
for example you want to spawn an infernus ;
forward it
forward Spawncar(playerid,model);
make a variable;
new Spawncar[MAX_PLAYERS];
Command
if(strcmp(cmd, "/infernus", true) == 0) {
Spawncar(playerid,411);
return 1;}
some example;
public Spawncar(playerid,model){
new Float;new Float:y;new Float:z;
GetPlayerPos(playerid, x, y, z);
new string[256];
if(IsPlayerInAnyVehicle(playerid)){
SendClientMessage(playerid, COLOR_RED, "You have alvredy a vehicle!");
}else{
if(Spawncar[playerid]==0){
Spawcar[playerid]=CarSpawnLimit;
new vehicleid=CreateVehicle(model, x+3, y, z, 900.00, -1, -1, -1);
}
just an example.
Ecko