Hey zusammen,
wollte grad einen /setmoney Befehl erstellen, den nur Admins ab lvl 3 Ausführen können Klappt aber nicht ganz:
Hier der befehl (DCMD):
Code
dcmd_setmoney(playerid, params[]);
{
if(IsPlayerAdminlevel(playerid,3)
{
new id, amount;
if(sscanf(params,"ud",id,amount)) return SendClientMessage(playerid,WEISS,"/setmoney [ID] [Betrag]");
new str[128], str2[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(id,name,sizeof(name));
format(str,sizeof(str),"A: Du hast das Geld des Spielers %s auf %d$ gesetzt!",name,amount);
format(str2,sizeof(str2),"A: Dein Geld wurde auf %d$ gesetzt!,amount);
SendClientMessage(playerid,HELLROT,str);
SendClientMessage(id,HELLROT,str2);
ResetPlayerMoney(id);
GivePlayerMoney(id,amount);
return 1;
}
else
{
SendClientMessage(playerid,HELLROT,"A: Du bist nicht befugt!");
return 1;
}
}
Alles anzeigen
Der IsPlayerAdminlevel stock:
Code
stock IsPlayerAdminlevel(playerid, level)
{
if(sSpieler[playerid][Adminlevel] >= level) return 1;
return 0;
}
Das Enum + sSpieler-Variable:
Code
enum Accountdaten
{
Level,
EXP,
Upgradepunkte,
Adminlevel,
Fraktion,
Rang,
Beruf,
Skill,
Skin,
Bargeld,
Bank,
};
new sSpieler[MAX_PLAYER][Accountdaten];
Alles anzeigen
Nun die Errors:
Code
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(880) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1041) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1046) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1105) : error 004: function "dcmd_setmoney" is not implemented
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1120) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1121) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1147) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1147) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1188) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1193) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1193) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1219) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1220) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1221) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1244) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1246) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1251) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1251) : warning 219: local variable "str2" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1274) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1276) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1281) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1281) : warning 219: local variable "str2" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1297) : error 055: start of function body without function header
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1298) : error 010: invalid function or declaration
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1301) : error 010: invalid function or declaration
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1304) : error 021: symbol already defined: "GetPlayerName"
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1311) : error 010: invalid function or declaration
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1313) : error 010: invalid function or declaration
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1316) : error 010: invalid function or declaration
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1347) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1352) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1353) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1379) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1380) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1382) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1406) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1407) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1416) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1433) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1472) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1472) : warning 219: local variable "amount" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1473) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1474) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1474) : warning 219: local variable "str2" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1689) : warning 219: local variable "str" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1693) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1727) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1742) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1915) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(1945) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2031) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2043) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2062) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2086) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2145) : warning 203: symbol is never used: "amount"
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2145) : warning 203: symbol is never used: "id"
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2145) : warning 203: symbol is never used: "name"
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2145) : warning 203: symbol is never used: "str"
C:\Users\Simon\Desktop\GTA SA Server\gamemodes\NVRoleplay.pwn(2145) : warning 203: symbol is never used: "str2"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
8 Errors.
Alles anzeigen
Würde mich über schnelle Hilfe freuen, danke schonmal im Voraus!