23.07.2013, 04:09
O Windows Seven nгo executava o comando via cliente .. Alias, olha a data: 28.05.2010, 02:40:35
zCMD("/palavras Hello World", string);
new var1[300];
zCMD("bruno da silva inteligente", var1, 1);
print(var1);
new var1[300];
zCMD("bruno da silva gostoso", var1, 1);
print(var1);
Vocк nгo entendeu. Se eu pegar X parвmetro, eu tenho que pegar o X parвmetro mais toda strng final
pawn Code:
Sem contar que nгo funciona estes casos: pawn Code:
|
#include <DOF2> //Retire o #include <Dini> e poem isso
#define dini_Exists DOF2_FileExists
#define dini_Remove DOF2_RemoveFile
#define dini_Create DOF2_CreateFile
#define dini_Set DOF2_SetString
#define dini_Get DOF2_GetString
#define dini_IntSet DOF2_SetInt
#define dini_Int DOF2_GetInt
#define dini_BoolSet DOF2_SetBool
#define dini_Bool DOF2_GetBool
#define dini_FloatSet DOF2_SetFloat
#define dini_Float DOF2_GetFloat
#define dini_Unset DOF2_Unset
#define dini_Isset DOF2_IsSet
Converter Dini para DOF2:
pawn Code:
|
DOF2_Exit();
Converter Dini para DOF2:
pawn Code:
|
jб existe isto na include, й sу usar "DINI_CONVERT". http://pastebin.com/TQJGwYyZ
|
stock
OrderValue(vec[])
{
for (new i = 0; vec[i]; i++)
{
new aux = -1;
for (new j = 0; j < strlen(vec) - 1; j++)
{
if (vec[j] > vec[j + 1])
{
aux = vec[j];
vec[j] = vec[j + 1];
vec[j + 1] = aux;
}
}
}
}
public OnGameModeInit()
{
new v[5];
sscanf("1,6,2,9,5", "p<,>a<i>[5]", v);
for (new i = 0; i < sizeof(v); ++i)
{
printf("v%d: %d", i, v[i]);
}
OrderValue(v);
print("\n");
for (new i = 0; i < sizeof(v); ++i)
{
printf("v%d: %d", i, v[i]);
}
return 1;
}
Ordenaзгo pelo mйtodo de bolha:
pawn Code:
pawn Code:
Quando passado para o OrderValue, ele voltarб ordenado em ordem crescente: 1,2,5,6,9 |
new
_uservehicle[ MAX_PLAYERS ]
;
public OnPlayerConnect(playerid){
return _uservehicle[ playerid ] = -1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
if(!strfind(cmdtext, "/cv", true)){
if(strlen(cmdtext) == 3 || strlen(cmdtext) == 4)
{
return SendClientMessage(playerid, -1, "(Erro): digite: /cv <modelo>");
}
strdel(cmdtext, 0, 3);
static
_model
;
_model = strval(cmdtext);
if(!(400 < _model < 600)){
return SendClientMessage(playerid, -1,"(Erro): modelo invбlido");
}
if(_uservehicle[playerid] != -1){
DestroyVehicle(_uservehicle[playerid]);
_uservehicle[playerid] = -1;
}
static
Float: _pos[3]
;
GetPlayerPos(playerid, _pos[0], _pos[1], _pos[2]);
_uservehicle[playerid] = CreateVehicle(_model, _pos[0], _pos[1], _pos[2], 0.0, -1, -1, 0);
PutPlayerInVehicle(playerid, _uservehicle[playerid], 0);
SendClientMessage(playerid, -1, #Divirta-se com seu novo veнculo!);
return true;
}
return false;
}
public OnPlayerExitVehicle(playerid, vehicleid){
if(_uservehicle[playerid] == vehicleid){
DestroyVehicle(vehicleid);
_uservehicle[playerid] = -1;
}
return true;
}
Destroi ao desconectar, й melhor. Se nгo o cara cria o carro, sai, ninguem entra no lugar dele e digita para criar outro carro e acaba ficando lб
|
new
_uservehicle[ MAX_PLAYERS ]
;
public OnPlayerConnect(playerid){
return DestroyVehicle(_uservehicle[ playerid ]), _uservehicle[ playerid ] = -1;
}
public OnPlayerCommandText(playerid, cmdtext[]){
if(!strfind(cmdtext, "/cv", true)){
if(strlen(cmdtext) == 3 || strlen(cmdtext) == 4)
{
return SendClientMessage(playerid, -1, "(Erro): digite: /cv <modelo>");
}
strdel(cmdtext, 0, 3);
static
_model
;
_model = strval(cmdtext);
if(!(400 < _model < 600)){
return SendClientMessage(playerid, -1,"(Erro): modelo invбlido");
}
if(_uservehicle[playerid] != -1){
DestroyVehicle(_uservehicle[playerid]);
_uservehicle[playerid] = -1;
}
static
Float: _pos[3]
;
GetPlayerPos(playerid, _pos[0], _pos[1], _pos[2]);
_uservehicle[playerid] = CreateVehicle(_model, _pos[0], _pos[1], _pos[2], 0.0, -1, -1, 0);
PutPlayerInVehicle(playerid, _uservehicle[playerid], 0);
SendClientMessage(playerid, -1, #Divirta-se com seu novo veнculo!);
return true;
}
return false;
}
public OnPlayerExitVehicle(playerid, vehicleid){
if(_uservehicle[playerid] == vehicleid){
DestroyVehicle(vehicleid);
_uservehicle[playerid] = -1;
}
return true;
}
if(!(400 < _model < 600)){
return SendClientMessage(playerid, -1,"(Erro): modelo invбlido");
}
Ta correto mano, pois os modelos vбlidos sгo maiores que 400 e menores que 600.
#Partiutrabalhar |
if(!(400 > _model < 600)){
return SendClientMessage(playerid, -1,"(Erro): modelo invбlido");
}
if(!(400 > _model < 600)){