25.04.2010, 13:56
pawn Код:
dcmd_vunlock(playerid, params[])
{
new file[128];
format(file,sizeof(file),"cars/%d.cfg",GetPlayerVehicleID(playerid));
if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, Yellow, "FAIL: You're not in a vehicle.");
else if(udb_hash(dini_Get(file,"OWNER")) != udb_hash(PlayerName(playerid))) return SendClientMessage(playerid, Yellow, "FAIL: You're not the owner of the vehicle.");
else
{
new text[128];
format(text,sizeof(text),"*%s picks up his keys and unlocks the vehicle",PlayerName(playerid));
dini_IntSet(file,"LOCK",0);
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid, X, Y, Z);
for(new i = 0; i < MAX_PLAYERS; i++)
{
SetVehicleParamsForPlayer(GetPlayerVehicleID(playerid),i,0,0);
if(IsPlayerInRange(i,10.0,10.0,X,Y,Z))
{
SendClientMessage(i, Purple, text);
}
}
}
return 1;
}