Velocity Tutorial

Kako koristiti Velocity Funkcije
Kreirati skriptu da skače 10ft (3m) u vozilu ili voziti brzinom svetlosti bez hakovanja je lako sa SetPlayerVelocity; i OnPlayerKeyStateChange

Prvo, hajde da počnemo dodavati definicije i tajmer.

(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) new Odkucaj[MAX_PLAYERS]; public OnPlayerUpdate(playerid) {	Odkucaj[playerid]++; if(Odkucaj[playerid] != 3) return 1; Odkucaj[playerid] = 0; new Keys,up,down; GetPlayerKeys(playerid,Keys,up,down); new Float:x,Float:y,Float:z; if(Keys &= 1024) {  		if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) {			GetPlayerVelocity(playerid,x,y,z); SetPlayerVelocity(playerid,x*1.2,y*1.2,z*1.2); }	} 	else if(Keys &= 4) {       	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {			GetVehicleVelocity(GetPlayerVehicleID(playerid),x,y,z); SetVehicleVelocity(GetPlayerVehicleID(playerid),x*1.2,y*1.2,z*1.2); }	}	return 1; }
 * 1) include 
 * 1) define PRITISNUT(%0) \

Ovaj sledeći deo će vam pokazadi kako da skočite 10ft(3m) u vazduh sa vozilom.

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {	if (PRITISNUT(KEY_HANDBRAKE)) // Change KEY_HANDBRAKE to your choice of PlayerKeys {       new Float:x, Float:y, Float:z; GetVehicleVelocity(GetPlayerVehicleID(playerid), x, y, z); SetVehicleVelocity(GetPlayerVehicleID(playerid) ,x ,y ,z+0.3); }	return 1; }

Sve što treba da uradite jeste da držite levi ALT u vozilu kako bi ste ga ubrzali. Pritisnite handbrake(Space) kako bi ste skakali sa vozilom.