pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT
#include <a_samp>
new Text:Textdraw0;
new Text:Textdraw1;
enum PlayerInfo
{
Masculino,
Feminino
};
new pInfo[MAX_PLAYERS][PlayerInfo];
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
public OnGameModeInit()
{
Textdraw0 = TextDrawCreate(68.000000, 139.000000, "Genero:");
TextDrawBackgroundColor(Textdraw0, 255);
TextDrawFont(Textdraw0, 1);
TextDrawLetterSize(Textdraw0, 0.500000, 1.000000);
TextDrawColor(Textdraw0, -1);
TextDrawSetOutline(Textdraw0, 0);
TextDrawSetProportional(Textdraw0, 1);
TextDrawSetShadow(Textdraw0, 1);
Textdraw1 = TextDrawCreate(137.000000, 140.000000, "selecione");
TextDrawBackgroundColor(Textdraw1, 255);
TextDrawFont(Textdraw1, 1);
TextDrawLetterSize(Textdraw1, 0.500000, 1.000000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw1, 0);
TextDrawSetProportional(Textdraw1, 1);
TextDrawSetShadow(Textdraw1, 1);
TextDrawSetSelectable(Textdraw1, true);
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
return 1;
}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
TextDrawSetSelectable(Textdraw1, true);
/*new String[128]; // Define a String
format(String, sizeof(String), "Masculino"); // Formata o Score utilizando Numero Inteiro "%d"
TextDrawSetString(Textdraw1, String);*/
return 1;
}
public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
/*if(clickedid == Textdraw1)
{
new String[128];
format(String, sizeof(String), "Masculino");
TextDrawSetString(Textdraw1, String);
}
else if(clickedid == Textdraw1)
{
new String[128]; // Define a String
format(String, sizeof(String), "Femenino");
TextDrawSetString(Textdraw1, String);
}*/
if(clickedid == Textdraw1)
{
if (pInfo[playerid][Feminino] == 1)//Mude o 'pInfo' para a do seu GameMod
{
new String[128];
format(String, sizeof(String), "Masculino");
TextDrawSetString(Textdraw1, String);
pInfo[playerid][Masculino] = 1;//variavel masculino
}
else
SendClientMessage(playerid, -1, "Vocк ja e do sexo masculino");
}
else if(clickedid == Textdraw1)
{
if (pInfo[playerid][Masculino] == 1)//Mude o 'pInfo' para a do seu GameMod
{
new String[128];
format(String, sizeof(String), "Feminino");
TextDrawSetString(Textdraw1, String);
pInfo[playerid][Feminino] = 1;//variavel feminino
}
else
SendClientMessage(playerid, -1, "Vocк ja e do sexo feminino");
}
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/teste", cmdtext, true, 10) == 0)
{
TextDrawShowForPlayer(playerid, Textdraw0);
TextDrawShowForPlayer(playerid, Textdraw1);
SelectTextDraw(playerid, 0xFFFFFFFF);
return 1;
}
return 0;
}