//debajo de los includes:
#define POLICIA 1
#define CIVIL 2
new gTeam[MAX_PLAYERS]];
public OnGameModeInit()
{
//aqui agregas todos los skin que tu quieras que se puedan seleccionar.
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
switch(classid){
case 0, 1, 2, 3, 4, 5:{//reemplaza los numeros por los skin de los policias
gTeam[playerid] = POLICIA;
GameTextForPlayer(playerid, "~W~Eres un ~B~Policia", 2000, 0);
}
else{
gTeam[playerid] = CIVIL;
GameTextForPlayer(playerid, "~W~Eres un ~R~Civil", 2000, 0);
}
}
return 1;
}
public OnPlayerSpawn(playerid)
{
if(gTeam[playerid] == POLICIA)return SetPlayerColor(playerid, 0x0000FFFF);
return SetPlayerColor(playerid, 0xFF0000FF);
}
Originally Posted by the_chaoz
Si no tambien puedes mirar este TUTORIAL
|
#include <a_samp> #include <dini> #include <dudb> #define COLOR_VERDE 0x00AF00FF new IsLogged[MAX_PLAYERS]; new IsRegistered[MAX_PLAYERS]; enum pInfo { pAdmin, pKills, pDeaths, pLogins } new PlayerInfo[MAX_PLAYERS][pInfo]; public OnPlayerConnect(playerid) { IsLogged[playerid] = 0; IsRegistered[playerid] = 0; new Nombre[MAX_PLAYERS]; new file[MAX_PLAYERS]; GetPlayerName(playerid, Nombre, sizeof(Nombre)); format(file, sizeof(file), "%s.ini", Nombre); if(fexist(file)) { IsRegistered[playerid] = 1; } if(IsRegistered[playerid] == 0) { SendClientMessage(playerid, 0xFFFFFFFF, "Cuenta sin registrar, por favor registrate: /Registrar [Contraseсa]"); } else { SendClientMessage(playerid, 0xFFFFFFFF, "Cuenta registrada, por favor identificate: /Sesion [Contraseсa]"); } return 1; } public OnPlayerDisconnect(playerid) { new Nombre[MAX_PLAYERS]; new file[MAX_PLAYERS]; GetPlayerName(playerid, Nombre, sizeof(Nombre)); format(file, sizeof(file), "%s.ini", Nombre); if(IsLogged[playerid] == 1) { dini_IntSet(file, "Admin", PlayerInfo[playerid][pAdmin]); dini_IntSet(file, "Kills", PlayerInfo[playerid][pKills]); dini_IntSet(file, "Deaths", PlayerInfo[playerid][pDeaths]); dini_IntSet(file, "Logins", PlayerInfo[playerid][pLogins]); } return 1; } public OnPlayerDeath(playerid, killerid, reason) { PlayerInfo[playerid][pDeaths] ++; PlayerInfo[killerid][pKills] ++; return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { new cmd[256]; new idx; cmd = strtok(cmdtext, idx); if(strcmp(cmd, "/Registrar", true) == 0) { new tmp[256]; new Nombre[MAX_PLAYERS]; new String[100]; new file[MAX_PLAYERS]; GetPlayerName(playerid, Nombre, sizeof(Nombre)); tmp = strtok(cmdtext, idx); format(file, sizeof(file), "%s.ini", Nombre); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFFF, "Use: /Registrar [Contraseсa]"); return 1; } if(!fexist(file)) { dini_Create(file); dini_IntSet(file, "Password", udb_hash(tmp)); dini_IntSet(file, "Admin", 0); dini_IntSet(file, "Kills", 0); dini_IntSet(file, "Deaths", 0); dini_IntSet(file, "Logins", 1); PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin"); PlayerInfo[playerid][pKills] = dini_Int(file, "Kills"); PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths"); PlayerInfo[playerid][pLogins] = dini_Int(file, "Logins"); format(String, sizeof(file), "Cuenta creada exitosamente! %s - ''%s''", Nombre, tmp); SendClientMessage(playerid, 0xFFFFFFFF, String); SendClientMessage(playerid, 0xFFFFFFFF, "Has sido identificado automбticamente"); IsLogged[playerid] = 1; } else { SendClientMessage(playerid, 0xFFFFFFFF, "Error: La cuenta ya estб registrada"); } return 1; } if(strcmp(cmd, "/Sesion", true) == 0) { new tmp[256]; new tmp2[256]; new Nombre[MAX_PLAYERS]; new file[MAX_PLAYERS]; GetPlayerName(playerid, Nombre, sizeof(Nombre)); format(file, sizeof(file), "%s.ini", Nombre); tmp = strtok(cmdtext, idx); tmp2 = dini_Get(file, "Password"); if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFFF, "Use: /Sesion [Contraseсa]"); return 1; } if(IsLogged[playerid] == 1) { SendClientMessage(playerid, COLOR_VERDE, "Tъ ya estбs identificado!"); return 1; } else { if(fexist(file)) { if(udb_hash(tmp) == strval(tmp2)) { IsLogged[playerid] = 1; PlayerInfo[playerid][pAdmin] = dini_Int(file, "Admin"); PlayerInfo[playerid][pKills] = dini_Int(file, "Kills"); PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths"); PlayerInfo[playerid][pLogins] = dini_Int(file, "Logins"); PlayerInfo[playerid][pLogins] ++; SendClientMessage(playerid, COLOR_VERDE, "Te has identificado exitosamente."); } } } return 1; } if (strcmp("/Cuenta", cmdtext, true, 10) == 0) { new Nombre[MAX_PLAYERS]; new String[100]; GetPlayerName(playerid, Nombre, sizeof(Nombre)); format(String, sizeof(String), "%s Estadisticas:", Nombre); SendClientMessage(playerid, 0xFFFFFFFF, String); format(String, sizeof(String), "Asesinatos: %d - Muertes: %d - Radio: %0.2f - Logins: %d", PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], Float:PlayerInfo[playerid][pKills]/PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pLogins]); SendClientMessage(playerid, 0xFFFFFFFF, String); return 1; } return 0; }
Originally Posted by the_chaoz
esto no va como un fs, va como un GM xD
|
C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dutils.inc(298) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dutils.inc(462) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dini.inc(46) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Administrador\Escritorio\Server de samp\pawno\include\dini.inc(54) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(45) : error 020: invalid symbol name "" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(148) : warning 215: expression has no effect C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(188) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(191) : error 020: invalid symbol name "" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(192) : error 020: invalid symbol name "" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(196) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(198) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(202) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(206) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(218) : error 020: invalid symbol name "" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(219) : error 020: invalid symbol name "" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(223) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(230) : error 010: invalid function or declaration C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(357) : error 021: symbol already defined: "cmd" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(358) : error 021: symbol already defined: "idx" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(363) : warning 219: local variable "tmp" shadows a variable at a preceding level C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(364) : error 001: expected token: "-identifier-", but found "[" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(366) : error 001: expected token: "-identifier-", but found "[" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 001: expected token: ")", but found "sizeof" C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : error 029: invalid expression, assumed zero C:\Documents and Settings\Administrador\Escritorio\Server de samp\gamemodes\Rapido&Furioso.pwn(367) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 20 Errors.