Hallo. Ich habe einen Rob befehl. Leider bekomme ich beim Compilen warnings!
Warnings:
: warning 204: symbol is assigned a value that is never used: "string1"
: warning 204: symbol is assigned a value that is never used: "string1"
: warning 204: symbol is assigned a value that is never used: "string1"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
3 Warnings.
Befehl:
ocmd:rob(playerid, params[])
{
new targetid;
new rob = random(10);
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, WEIS, "Benutzen: /rob [id]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, ROT, "Der Spieler ist nicht Online!");
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(!IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) return SendClientMessage(playerid, ROT, "Der Spieler ist zu weit entfernt!");
if(GetPlayerMoney(targetid) < 100) return SendClientMessage(playerid, ROT, "Der Spieler hat nicht genug Geld!");
new money = GetPlayerMoney(targetid);
{
new targetid;
new rob = random(10);
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, WEIS, "Benutzen: /rob [id]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, ROT, "Der Spieler ist nicht Online!");
new Float:x, Float:y, Float:z;
GetPlayerPos(targetid, x, y, z);
if(!IsPlayerInRangeOfPoint(playerid, 5, x, y, z)) return SendClientMessage(playerid, ROT, "Der Spieler ist zu weit entfernt!");
if(GetPlayerMoney(targetid) < 100) return SendClientMessage(playerid, ROT, "Der Spieler hat nicht genug Geld!");
new money = GetPlayerMoney(targetid);
if(rob == 0 || rob == 1)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
GivePlayerMoney(playerid, money / 10);
GivePlayerMoney(targetid, -money / 10);
format(string,sizeof(string),"%s hat %s ausgeraubt!",name, name2);
SendClientMessageToAll(LILA,string);
format(string,sizeof(string),"Du hast $%d erbeutet", money/10);
SendClientMessage(playerid,GELB,string);
format(string,sizeof(string),"Du wurdest ausgeraubt! Verlust: $%d", money/10);
SendClientMessage(targetid,ROT,string);
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
GivePlayerMoney(playerid, money / 10);
GivePlayerMoney(targetid, -money / 10);
format(string,sizeof(string),"%s hat %s ausgeraubt!",name, name2);
SendClientMessageToAll(LILA,string);
format(string,sizeof(string),"Du hast $%d erbeutet", money/10);
SendClientMessage(playerid,GELB,string);
format(string,sizeof(string),"Du wurdest ausgeraubt! Verlust: $%d", money/10);
SendClientMessage(targetid,ROT,string);
}
else if(rob == 2 || rob == 4)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
GivePlayerMoney(playerid, money / 20);
GivePlayerMoney(targetid, -money / 20);
format(string,sizeof(string),"%s hat %s ausgeraubt!",name, name2);
SendClientMessageToAll(LILA,string);
format(string,sizeof(string),"Du hast $%d erbeutet!", money/20);
SendClientMessage(playerid,GELB,string);
format(string,sizeof(string),"Du wurdest ausgeraubt! Verlust: $%d", money/20);
SendClientMessage(targetid,ROT,string);
else if(rob == 2 || rob == 4)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
GivePlayerMoney(playerid, money / 20);
GivePlayerMoney(targetid, -money / 20);
format(string,sizeof(string),"%s hat %s ausgeraubt!",name, name2);
SendClientMessageToAll(LILA,string);
format(string,sizeof(string),"Du hast $%d erbeutet!", money/20);
SendClientMessage(playerid,GELB,string);
format(string,sizeof(string),"Du wurdest ausgeraubt! Verlust: $%d", money/20);
SendClientMessage(targetid,ROT,string);
}
else if(rob == 5 || rob == 6)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
GivePlayerMoney(playerid, money / 5);
GivePlayerMoney(targetid, -money / 5);
format(string,sizeof(string),"%s hat %s ausgeraubt!",name, name2);
SendClientMessageToAll(LILA,string);
format(string,sizeof(string),"Du hast $%d erbeutet", money/5);
SendClientMessage(playerid,GELB,string);
format(string,sizeof(string),"Du wurdest ausgeraubt! Verlust: $%d", money/5);
SendClientMessage(targetid,ROT,string);
else if(rob == 5 || rob == 6)
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
GivePlayerMoney(playerid, money / 5);
GivePlayerMoney(targetid, -money / 5);
format(string,sizeof(string),"%s hat %s ausgeraubt!",name, name2);
SendClientMessageToAll(LILA,string);
format(string,sizeof(string),"Du hast $%d erbeutet", money/5);
SendClientMessage(playerid,GELB,string);
format(string,sizeof(string),"Du wurdest ausgeraubt! Verlust: $%d", money/5);
SendClientMessage(targetid,ROT,string);
}
else
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
format(string,sizeof(string),"%s hat dich bemerkt! Renn lieber weg!", name2);
SendClientMessage(playerid, ROT, string);
format(string,sizeof(string),"%s hat versucht dich auszurauben!", name);
SendClientMessage(targetid, ROT, string);
format(string1,sizeof(string1),"%s hat versucht %s auszurauben! Er schlug fehl!", name, name2);
SendClientMessageToAll(ROT,string1);
}
return 1;
}
else
{
new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
new name2[MAX_PLAYER_NAME], string1[24+MAX_PLAYER_NAME];
GetPlayerName(targetid, name2, sizeof(name2));
format(string,sizeof(string),"%s hat dich bemerkt! Renn lieber weg!", name2);
SendClientMessage(playerid, ROT, string);
format(string,sizeof(string),"%s hat versucht dich auszurauben!", name);
SendClientMessage(targetid, ROT, string);
format(string1,sizeof(string1),"%s hat versucht %s auszurauben! Er schlug fehl!", name, name2);
SendClientMessageToAll(ROT,string1);
}
return 1;
}
MFG