if ( strcmp ( cmdtext , "/teleportname", true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid, 0);
SetPlayerInterior(playerid, 0);
SetVehicleZAngle(vehicleid,0);
return SetVehiclePos(vehicleid, X,Y,Z);
}else{
SetPlayerPos(playerid, X,Y,Z);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Originally Posted by Kar
doesnt work.. brackets problem L
|
public OnPlayerCommandText(playerid, cmdtext[]) { if ( strcmp ( cmdtext , "/drift1", true)==0) { new vehicleid = GetPlayerVehicleID(playerid); new State = GetPlayerState(playerid); if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER) { LinkVehicleToInterior(vehicleid, 0); SetPlayerInterior(playerid, 0); SetVehicleZAngle(vehicleid,0); return SetVehiclePos(vehicleid, 329.3348,1536.3771,76.6117); }else{ SetPlayerPos(playerid, 329.3348,1536.3771,76.6117); SetPlayerInterior(playerid, 0); } return 1; }
if ( strcmp ( cmdtext , "/drift1", true)==0)
{
new vehicleid = GetPlayerVehicleID(playerid);
new State = GetPlayerState(playerid);
if (IsPlayerInAnyVehicle(playerid) && State == PLAYER_STATE_DRIVER)
{
LinkVehicleToInterior(vehicleid, 0);
SetPlayerInterior(playerid, 0);
SetVehicleZAngle(vehicleid,0);
SetVehiclePos(vehicleid, 329.3348,1536.3771,76.6117);
}else{
SetPlayerPos(playerid, 329.3348,1536.3771,76.6117);
SetPlayerInterior(playerid, 0);
}
return 1;
}
Originally Posted by Kar
it works but now instead of getting teled to drift1 it teles me near area69 in the fly and i fall to death..
and i get this error "function "onplayercommandtext"should have a return value |
SetPlayerPos(playerid, 329.3348,1536.3771,76.6117);
Originally Posted by Kar
i got rid of the error now it just teles me to the wrong place..
|