Originally Posted by OTACON
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/Objeto", cmdtext, true, 10) == 0) { if(IsPlayerInAnyVehicle(playerid)) //Tu Error = no abres la llave if(!IsValidObject(Objeto[playerid])) { new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(GetPlayerFacingAngle(playerid), x, y, z); //Tu Error = GetPlayerFacingAngle(playerid) = playerid GetPlayerFacingAngle(GetPlayerVehicleID(playerid), a); //Tu Error = GetPlayerVehicleID(playerid) = playerid GetXYInfrontOfPlayer(playerid, x, y, 10.0); //Tu Error = GetXYInfrontOfPlayer = GetXYInFrontOfPlayer (Fron esta sin mayuscula la inicial) Objeto[playerid] = CreateObject(1655, x, y, z, 0.0, 0.0, a); } } } // //Tu Error = una llave de mas return 1; } if (strcmp("/Quitarobjeto", cmdtext, true, 10) == 0) { if(IsValidObject(Objeto[playerid])) //Tu Error = no abres la llave DestroyObject(Objeto[playerid]); } return 1; } return 0; }
pawn Код:
#include <a_samp> new Objeto[MAX_PLAYERS]; public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/Objeto", cmdtext, true, 10) == 0) { if(IsPlayerInAnyVehicle(playerid)) { if(!IsValidObject(Objeto[playerid])) { new Float:pos[4]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); GetPlayerFacingAngle(playerid, pos[3]); GetXYInFrontOfPlayer(playerid, pos[0], pos[1], 10.0); Objeto[playerid] = CreateObject(1655, pos[0], pos[1], pos[2], 0.0, 0.0, pos[3]); } } } if (strcmp("/Quitarobjeto", cmdtext, true, 10) == 0) { if(IsValidObject(Objeto[playerid])) { DestroyObject(Objeto[playerid]); } } return 0; } stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance) { new Float:a; GetPlayerPos(playerid, x, y, a); GetPlayerFacingAngle(playerid, a); x += (distance * floatsin(-a, degrees)); y += (distance * floatcos(-a, degrees)); }
|