pawn Код:
if(strcmp(cmd, "/recovercar", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /recovercar [VehID]");
new vehicleid = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 5)
{
SetVehicleToRespawn(vehicleid);
SetVehicleVirtualWorld(vehicleid, 0);
SendClientMessage(playerid, COLOR_GREY, "* Vehicle respawned, in VirtualWorld 0.");
OnPropUpdate(4,vehicleid);
OnPlayerUpdateEx(playerid);
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/gotocar", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /gotocar [carid]");
return 1;
}
new testcar = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 4)
{
new vehworld = GetVehicleVirtualWorld(testcar);
if (vehworld == 63 || 65) return SendClientMessage(playerid, COLOR_GREY, "Error! This vehicle is not spawned by it's owner.");
new Float:cwx2,Float:cwy2,Float:cwz2;
GetVehiclePos(testcar, cwx2, cwy2, cwz2);
if (GetPlayerState(playerid) == 2)
{
SetVehicleToRespawn(GetPlayerVehicleID(playerid));
SafeRemovePlayerFromVehicle(playerid);
SafeSetPlayerPos(playerid, cwx2,cwy2,cwz2+2);
}
else
{
SafeSetPlayerInterior(playerid,0);
SafeSetPlayerPos(playerid, cwx2,cwy2,cwz2+2);
}
SendClientMessage(playerid, COLOR_ORANGE, "** You have been teleported");
OnPlayerExitFood(playerid);
format(string, sizeof(string), "[ADMIN]: %s Has Teleported Himself To Car: [%d].", sendername, testcar);
ABroadCast(COLOR_LIGHTRED,string, 5);
DisablePlayerCheckpoint(playerid);
new y, m, d;
new h,mi,s;
getdate(y,m,d);
gettime(h,mi,s);
format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s Has Teleported Himself to Car Id: [%d]",d,m,y,h,mi,s,sendername,testcar);
TelesLog(string);
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, "** You are not authorized to use that command!");
return 1;
}
}
return 1;
}
Can someone explain why I always get the error, car isnt spawned by the owner? -- That should work rite?