What's wrong with this ?[HELP]
#1

i want to create a player in the front of the player so i did that :
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
AddStaticVehicle(400,x,y,z+2);
get 3 warnings :
Код:
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\TEST.pwn(1993) : warning 202: number of arguments does not match definition
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\TEST.pwn(1993) : warning 202: number of arguments does not match definition
C:\DOCUME~1\PC\Bureau\cs\GAMEMO~1\TEST.pwn(1993) : warning 202: number of arguments does not match definition
I hope you help me .
Reply
#2

pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
AddStaticVehicle(400,x,y,z+2,color1,color2);
Replace color1, color2 with the color id's you want.
Reply
#3

Quote:

AddStaticVehicle(modelid, Float:X, Float:Y, Float:Z, Float:Angle, color1, color2);

Oh and you can only use "AddStaticVehicle" under "OnGameModeInit" or "OnFilterScriptInit". If you are interested in creating vehicles during game-runtime, use "CreateVehicle".
Reply
#4

You forgot the colors:

pawn Код:
AddStaticVehicle(400,x,y,z+2,COLOR,COLOR);
You can find the colors here:

https://sampwiki.blast.hk/wiki/Colors_List
Reply
#5

Quote:
Originally Posted by Twisted_Insane
Посмотреть сообщение
You forgot the colors:

pawn Код:
AddStaticVehicle(400,x,y,z+2,COLOR,COLOR);
You can find the colors here:

https://sampwiki.blast.hk/wiki/Colors_List
thank you all for your repplys
not working

and yes i want to spawn a car in runing game (not ongamemodint):

i tryed CreateVehicle but i didn't understand some functions :
pawn Код:
CreateVehicle(400,x,y,z,Float:rotation,4,5,respawn_delay);
Float:rotation= rotation of the vehicle ? witch value can i set to it ?
respawn_delay= i know what does it mean , but can i have a value for it ?
Reply
#6

Lol, no...Do it like this, that's an example:

pawn Код:
new Float:x, Float:y, Float:z, Float:angle; //define x-y-z-angle
    GetPlayerPos(playerid, x, y, z); //get the player's position
    GetPlayerFacingAngle(playerid, angle); //get the player's angle
    new veh = CreateVehicle(429, x, y, z, angle, 0, 0, 60); //modelid, x-y-z-angle, color1, color 2, respawn-delay
Reply
#7

Here you have:

Код:
Float:rotation= This is the rotation of the vehicle , Means facing angle of vehicle
respawn_delay= set 0 if you dont want to respawn vehicle
Reply
#8

??i think there are an error with the code you gave (undefined symbole angle)

EDIT :

Shabi thank u for the help i tryed all but whene IG, i can't see the spawned car .
this is all command :
pawn Код:
dcmd_car1(playerid, params[])
{
#pragma unused params
if (Tester[playerid] == 1) { // if the player's tester variable is 1
new Float:x,Float:y,Float:z;
CreateVehicle(400,x,y,z+2,4,4,5,0); // spawn a car in the front of him
SendClientMessage(playerid, COLOR_WHITE,"you spawned a car.");
}
else { // else nothing happen
SendClientMessage(playerid, COLOR_CERVENA,"You are not a beta-tester !");
}
return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)