Szerző Téma: RangeOfPoint  (Megtekintve 1097 alkalommal)

RangeOfPoint
« Dátum: 2011. szeptember 24. - 10:58:02 »
0 Show voters
if(strcmp(cmd, \"/arrest\", true) == 0 || strcmp(cmd, \"/ar\", true) == 0)
{
new string[250];
    if(IsSpawned[playerid] == 0)
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2264.9851,2452.1541,10.8203) || IsPlayerInRangeOfPoint(playerid, 5.0, -1622.8282,682.0357,7.1901) || IsPlayerInRangeOfPoint(playerid, 5.0, 1539.1221,-1672.4889,13.5469))
{
SendClientMessage(playerid, COLOR_ERROR, \"Halott vagy igy nemhasználhatod\");
    return 1;
    }
    if(gTeam[playerid] != COP && gTeam[playerid] != SWAT && gTeam[playerid] != ARMY && gTeam[playerid] != FBI)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Te nemvagy rendvédelmis \");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_ERROR, \"/ar (id)\");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsNumeric(tmp))
{
    SendClientMessage(playerid, COLOR_ERROR, \"/ar (id) \");
    return 1;
    }
    if(!IsPlayerConnected(giveplayerid))
{
    format(string, sizeof(string), \"ID (%d) Nincs a szerveren\", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new oname[24];
    new pname[24];
    GetPlayerName(playerid,oname, 24);
GetPlayerName(giveplayerid, pname, 24);
if(GetPlayerWantedLevel(giveplayerid) <= 3)
{
format(string, sizeof(string), \"%s(%d) Nincs ellene elfogató parancs, nem követett el semmit.\",pname,giveplayerid);
SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsPlayerInAnyVehicle(playerid))
{
    SendClientMessage(playerid,COLOR_ERROR,\"Mivel autóban van igy nemtudod letartóztatni\");
    return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 10)
{
    format(string, sizeof(string), \"%s(%d) Túl messze van így nemtartóztathatod le\",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsSpawned[giveplayerid] == 0)
{
format(string, sizeof(string), \"%s(%d) Õ Halott... Igy nemtod lecsukni\",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    SetPlayerVirtualWorld(giveplayerid,0);
    if(GetPlayerWantedLevel(playerid) >=1)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Ezt a parancsot csak a zsaruk használhatják\");
    return 1;
    }
    if(giveplayerid == playerid)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Magadat akarod letartóztatni?\");
    return 1;
    }
    new spawn = random(sizeof(PrisonSpawn)), string2[250], Float:health, copname[MAX_PLAYER_NAME], arrested[MAX_PLAYER_NAME];
    GetPlayerName(playerid, copname, sizeof(copname));
    GetPlayerName(strval(tmp), arrested, sizeof(arrested));
    GetPlayerHealth(strval(tmp), health);
SendClientMessage(strval(tmp), GREY, \"San Andreas Rendõrség\");
format(string, sizeof(string), \"Rendõrtiszt %s Letartóztatott téged.\", copname);
SendClientMessage(strval(tmp), WHITE, string);
ResetPlayerWeapons(strval(tmp));
SetPlayerPos(strval(tmp), PrisonSpawn[spawn][0], PrisonSpawn[spawn][1], PrisonSpawn[spawn][2]);
SetPlayerFacingAngle(strval(tmp), PrisonSpawn[spawn][3]);
SetCameraBehindPlayer(strval(tmp));
if(GetPlayerWantedLevel(strval(tmp)) >= 4 && GetPlayerWantedLevel(strval(tmp)) <= 5)
{
PrisonTime[strval(tmp)] = 60;
GivePlayerMoney(playerid,25000);
GivePlayerScore(playerid,1);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 6 && GetPlayerWantedLevel(strval(tmp)) <= 8)
{
PrisonTime[strval(tmp)] = 120;
GivePlayerMoney(playerid,35000);
GivePlayerScore(playerid,1);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 9 && GetPlayerWantedLevel(playerid) <= 11)
{
PrisonTime[strval(tmp)] = 180;
GivePlayerMoney(playerid,45000);
GivePlayerScore(playerid,2);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 12 && GetPlayerWantedLevel(strval(tmp)) <= 14)
{
PrisonTime[strval(tmp)] = 240;
GivePlayerMoney(playerid,55000);
GivePlayerScore(playerid,2);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 15)
{
PrisonTime[strval(tmp)] = 300;
GivePlayerMoney(playerid,65000);
GivePlayerScore(playerid,3);
}
SetPlayerWantedLevel(strval(tmp), 0);
SetPlayerInterior(strval(tmp),3);
SetPlayerHealth(strval(tmp),99999);
TogglePlayerControllable(strval(tmp), true);
SetPlayerJailed(strval(tmp), true);
format(string2, sizeof(string2), \"Rendõrtiszt %s[iD:%d] letartóztatta %s[iD:%d] -t.\", copname, playerid, arrested, strval(tmp));
Announce(string2);
if(health <= 90)
{
    SendClientMessage(strval(tmp), GREY, \"San Andreas Rendõrség\");
    SendClientMessage(strval(tmp), WHITE, \"Ettél valami kaját.\");
    SetPlayerHealth(strval(tmp), health+10);
    ApplyAnimation(strval(tmp), \"FOOD\", \"EAT_Burger\", 4.0, 0, 0, 0, 0, 0);
}
    return 1;
    }

 
Az egyik parancsom igy van megcsinállva. Müködik semmi baja csak annyi hogy akárhol tom használni a parancsot.
valaki kijavítaná?

Nem elérhető DrAkE

  • 2078
    • Profil megtekintése
RangeOfPoint
« Válasz #1 Dátum: 2011. szeptember 24. - 11:02:33 »
0 Show voters
Idézetet írta: Pioneer date=1316854682\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"11779\" data-ipsquote-contentclass=\"forums_Topic

if(strcmp(cmd, \"/arrest\", true) == 0 || strcmp(cmd, \"/ar\", true) == 0)
{
new string[250];
    if(IsSpawned[playerid] == 0)
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2264.9851,2452.1541,10.8203) || IsPlayerInRangeOfPoint(playerid, 5.0, -1622.8282,682.0357,7.1901) || IsPlayerInRangeOfPoint(playerid, 5.0, 1539.1221,-1672.4889,13.5469))
{
SendClientMessage(playerid, COLOR_ERROR, \"Halott vagy igy nemhasználhatod\");
    return 1;
    }
    if(gTeam[playerid] != COP && gTeam[playerid] != SWAT && gTeam[playerid] != ARMY && gTeam[playerid] != FBI)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Te nemvagy rendvédelmis \");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_ERROR, \"/ar (id)\");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsNumeric(tmp))
{
    SendClientMessage(playerid, COLOR_ERROR, \"/ar (id) \");
    return 1;
    }
    if(!IsPlayerConnected(giveplayerid))
{
    format(string, sizeof(string), \"ID (%d) Nincs a szerveren\", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new oname[24];
    new pname[24];
    GetPlayerName(playerid,oname, 24);
GetPlayerName(giveplayerid, pname, 24);
if(GetPlayerWantedLevel(giveplayerid) <= 3)
{
format(string, sizeof(string), \"%s(%d) Nincs ellene elfogató parancs, nem követett el semmit.\",pname,giveplayerid);
SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsPlayerInAnyVehicle(playerid))
{
    SendClientMessage(playerid,COLOR_ERROR,\"Mivel autóban van igy nemtudod letartóztatni\");
    return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 10)
{
    format(string, sizeof(string), \"%s(%d) Túl messze van így nemtartóztathatod le\",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsSpawned[giveplayerid] == 0)
{
format(string, sizeof(string), \"%s(%d) Õ Halott... Igy nemtod lecsukni\",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    SetPlayerVirtualWorld(giveplayerid,0);
    if(GetPlayerWantedLevel(playerid) >=1)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Ezt a parancsot csak a zsaruk használhatják\");
    return 1;
    }
    if(giveplayerid == playerid)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Magadat akarod letartóztatni?\");
    return 1;
    }
    new spawn = random(sizeof(PrisonSpawn)), string2[250], Float:health, copname[MAX_PLAYER_NAME], arrested[MAX_PLAYER_NAME];
    GetPlayerName(playerid, copname, sizeof(copname));
    GetPlayerName(strval(tmp), arrested, sizeof(arrested));
    GetPlayerHealth(strval(tmp), health);
SendClientMessage(strval(tmp), GREY, \"San Andreas Rendõrség\");
format(string, sizeof(string), \"Rendõrtiszt %s Letartóztatott téged.\", copname);
SendClientMessage(strval(tmp), WHITE, string);
ResetPlayerWeapons(strval(tmp));
SetPlayerPos(strval(tmp), PrisonSpawn[spawn][0], PrisonSpawn[spawn][1], PrisonSpawn[spawn][2]);
SetPlayerFacingAngle(strval(tmp), PrisonSpawn[spawn][3]);
SetCameraBehindPlayer(strval(tmp));
if(GetPlayerWantedLevel(strval(tmp)) >= 4 && GetPlayerWantedLevel(strval(tmp)) <= 5)
{
PrisonTime[strval(tmp)] = 60;
GivePlayerMoney(playerid,25000);
GivePlayerScore(playerid,1);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 6 && GetPlayerWantedLevel(strval(tmp)) <= 8)
{
PrisonTime[strval(tmp)] = 120;
GivePlayerMoney(playerid,35000);
GivePlayerScore(playerid,1);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 9 && GetPlayerWantedLevel(playerid) <= 11)
{
PrisonTime[strval(tmp)] = 180;
GivePlayerMoney(playerid,45000);
GivePlayerScore(playerid,2);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 12 && GetPlayerWantedLevel(strval(tmp)) <= 14)
{
PrisonTime[strval(tmp)] = 240;
GivePlayerMoney(playerid,55000);
GivePlayerScore(playerid,2);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 15)
{
PrisonTime[strval(tmp)] = 300;
GivePlayerMoney(playerid,65000);
GivePlayerScore(playerid,3);
}
SetPlayerWantedLevel(strval(tmp), 0);
SetPlayerInterior(strval(tmp),3);
SetPlayerHealth(strval(tmp),99999);
TogglePlayerControllable(strval(tmp), true);
SetPlayerJailed(strval(tmp), true);
format(string2, sizeof(string2), \"Rendõrtiszt %s[iD:%d] letartóztatta %s[iD:%d] -t.\", copname, playerid, arrested, strval(tmp));
Announce(string2);
if(health <= 90)
{
    SendClientMessage(strval(tmp), GREY, \"San Andreas Rendõrség\");
    SendClientMessage(strval(tmp), WHITE, \"Ettél valami kaját.\");
    SetPlayerHealth(strval(tmp), health+10);
    ApplyAnimation(strval(tmp), \"FOOD\", \"EAT_Burger\", 4.0, 0, 0, 0, 0, 0);
}
    return 1;
    }

 
Az egyik parancsom igy van megcsinállva. Müködik semmi baja csak annyi hogy akárhol tom használni a parancsot.
valaki kijavítaná?
 
Nem csodálom hogy nem megy, ilyen sor eltolódásokkal átláthatatlan a kódod.

RangeOfPoint
« Válasz #2 Dátum: 2011. szeptember 24. - 11:07:19 »
0 Show voters
Idézetet írta: DrAkE date=1316854953\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"11779\" data-ipsquote-contentclass=\"forums_Topic


 
if(strcmp(cmd, \"/arrest\", true) == 0 || strcmp(cmd, \"/ar\", true) == 0)
{
new string[250];
    if(IsSpawned[playerid] == 0)
    if(IsPlayerInRangeOfPoint(playerid, 5.0, 2264.9851,2452.1541,10.8203) || IsPlayerInRangeOfPoint(playerid, 5.0, -1622.8282,682.0357,7.1901) || IsPlayerInRangeOfPoint(playerid, 5.0, 1539.1221,-1672.4889,13.5469))
{
SendClientMessage(playerid, COLOR_ERROR, \"Halott vagy igy nemhasználhatod\");
    return 1;
    }
    if(gTeam[playerid] != COP && gTeam[playerid] != SWAT && gTeam[playerid] != ARMY && gTeam[playerid] != FBI)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Te nemvagy rendvédelmis \");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
{
    SendClientMessage(playerid, COLOR_ERROR, \"/ar (id)\");
    return 1;
    }
    giveplayerid = strval(tmp);
    if(!IsNumeric(tmp))
{
    SendClientMessage(playerid, COLOR_ERROR, \"/ar (id) \");
    return 1;
    }
    if(!IsPlayerConnected(giveplayerid))
{
    format(string, sizeof(string), \"ID (%d) Nincs a szerveren\", giveplayerid);
    SendClientMessage(playerid, COLOR_ERROR, string);
    return 1;
    }
    new oname[24];
    new pname[24];
    GetPlayerName(playerid,oname, 24);
GetPlayerName(giveplayerid, pname, 24);
if(GetPlayerWantedLevel(giveplayerid) <= 3)
{
format(string, sizeof(string), \"%s(%d) Nincs ellene elfogató parancs, nem követett el semmit.\",pname,giveplayerid);
SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsPlayerInAnyVehicle(playerid))
{
    SendClientMessage(playerid,COLOR_ERROR,\"Mivel autóban van igy nemtudod letartóztatni\");
    return 1;
    }
    if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 10)
{
    format(string, sizeof(string), \"%s(%d) Túl messze van így nemtartóztathatod le\",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    if(IsSpawned[giveplayerid] == 0)
{
format(string, sizeof(string), \"%s(%d) Õ Halott... Igy nemtod lecsukni\",pname,giveplayerid);
    SendClientMessage(playerid,COLOR_ERROR,string);
    return 1;
    }
    SetPlayerVirtualWorld(giveplayerid,0);
    if(GetPlayerWantedLevel(playerid) >=1)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Ezt a parancsot csak a zsaruk használhatják\");
    return 1;
    }
    if(giveplayerid == playerid)
{
    SendClientMessage(playerid,COLOR_ERROR,\"Magadat akarod letartóztatni?\");
    return 1;
    }
    new spawn = random(sizeof(PrisonSpawn)), string2[250], Float:health, copname[MAX_PLAYER_NAME], arrested[MAX_PLAYER_NAME];
    GetPlayerName(playerid, copname, sizeof(copname));
    GetPlayerName(strval(tmp), arrested, sizeof(arrested));
    GetPlayerHealth(strval(tmp), health);
SendClientMessage(strval(tmp), GREY, \"San Andreas Rendõrség\");
format(string, sizeof(string), \"Rendõrtiszt %s Letartóztatott téged.\", copname);
SendClientMessage(strval(tmp), WHITE, string);
ResetPlayerWeapons(strval(tmp));
SetPlayerPos(strval(tmp), PrisonSpawn[spawn][0], PrisonSpawn[spawn][1], PrisonSpawn[spawn][2]);
SetPlayerFacingAngle(strval(tmp), PrisonSpawn[spawn][3]);
SetCameraBehindPlayer(strval(tmp));
if(GetPlayerWantedLevel(strval(tmp)) >= 4 && GetPlayerWantedLevel(strval(tmp)) <= 5)
{
PrisonTime[strval(tmp)] = 60;
GivePlayerMoney(playerid,25000);
GivePlayerScore(playerid,1);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 6 && GetPlayerWantedLevel(strval(tmp)) <= 8)
{
PrisonTime[strval(tmp)] = 120;
GivePlayerMoney(playerid,35000);
GivePlayerScore(playerid,1);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 9 && GetPlayerWantedLevel(playerid) <= 11)
{
PrisonTime[strval(tmp)] = 180;
GivePlayerMoney(playerid,45000);
GivePlayerScore(playerid,2);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 12 && GetPlayerWantedLevel(strval(tmp)) <= 14)
{
PrisonTime[strval(tmp)] = 240;
GivePlayerMoney(playerid,55000);
GivePlayerScore(playerid,2);
}
else if(GetPlayerWantedLevel(strval(tmp)) >= 15)
{
PrisonTime[strval(tmp)] = 300;
GivePlayerMoney(playerid,65000);
GivePlayerScore(playerid,3);
}
SetPlayerWantedLevel(strval(tmp), 0);
SetPlayerInterior(strval(tmp),3);
SetPlayerHealth(strval(tmp),99999);
TogglePlayerControllable(strval(tmp), true);
SetPlayerJailed(strval(tmp), true);
format(string2, sizeof(string2), \"Rendõrtiszt %s[iD:%d] letartóztatta %s[iD:%d] -t.\", copname, playerid, arrested, strval(tmp));
Announce(string2);
if(health <= 90)
{
    SendClientMessage(strval(tmp), GREY, \"San Andreas Rendõrség\");
    SendClientMessage(strval(tmp), WHITE, \"Ettél valami kaját.\");
    SetPlayerHealth(strval(tmp), health+10);
    ApplyAnimation(strval(tmp), \"FOOD\", \"EAT_Burger\", 4.0, 0, 0, 0, 0, 0);
}
    return 1;
    }

 
Az egyik parancsom igy van megcsinállva. Müködik semmi baja csak annyi hogy akárhol tom használni a parancsot.
valaki kijavítaná?
 
Nem csodálom hogy nem megy, ilyen sor eltolódásokkal átláthatatlan a kódod.
 
[/quote]
De most kijavitottad amugy?

RangeOfPoint
« Válasz #3 Dátum: 2011. szeptember 24. - 19:47:19 »
0 Show voters
Ez nagyon nincs jól nincsenek jól a sorók majd ahogyan látom 2 helyen nincsen ;  :-X

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal