ocmd:endround befehl geht nicht richtig

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo Community,
    ich habe mir heute einen /endround Befehl gescriptet und er geht nicht richtig. Er soll wenn man den Befehl eingibt an alle admins die Adminlevel 2 oder höher sind eine TextDraw erstellen unter der Geldanzeige und soll von 5 Minuten runter zählen. Bei 0 Soll der Server neu gestartet werden.
    Oben im Script:

    new Text:endroundTD;
    forward EndroundTimer(playerid);

    Befehl:

    ocmd:endround(playerid,params[])
    {
    if(PlayerInfo[playerid][pEingeloggt] < 1 ) return SendClientMessage(playerid,Rot,"Du kannst diesen Befehl nicht nutzen, weil du nicht eingeloggt bist.");
    if(PlayerInfo[playerid][pAdminlevel] <= 1337)return SendClientMessage(playerid,Grau,"Du bist nicht befugt, diesen Befehl zu nutzen!");
    SetTimerEx("EndroundTimer", 1000, 0, "d", playerid);
    endround[playerid] = 60*5;
    endroundTD = TextDrawCreate(511.000000, 425.000000, "Endround 05:00");
    TextDrawBackgroundColor(endroundTD, 255);
    TextDrawFont(endroundTD, 1);
    TextDrawLetterSize(endroundTD, 0.300000, 1.000000);
    TextDrawColor(endroundTD, -1);
    TextDrawSetOutline(endroundTD, 0);
    TextDrawSetProportional(endroundTD, 1);
    TextDrawSetShadow(endroundTD, 1);
    TextDrawSetSelectable(endroundTD, 0);
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(PlayerInfo[i][pAdminlevel] >= 2)
    {
    TextDrawShowForPlayer(playerid,endround[playerid]);
    }
    }
    }
    SendClientMessageToAll(Blau,"SERVER: In 5 Minuten wird der Server neu gestartet.");
    return 1;
    }

    Public EndroundTimer:

    public EndroundTimer(playerid)
    {
    endround[playerid]--;
    new str[16];
    format(str, sizeof(str), "%02d:%02d", endround[playerid]/60, endround[playerid]%60);
    PlayerTextDrawSetString(playerid,endroundTD,str);
    if(endround[playerid] > 0) SetTimerEx("EndroundTimer", 1000, 0, "d", playerid);
    else
    {
    SendRconCommand("gmx");
    }
    return 1;
    }

    PS: Die TextDraws werden nicht angezeigt weder die Uhr noch das Datum... Ich habe daran nichts verändert und sie werden nicht angezeigt.

  • Habs jetzt rein gemacht aber es geht immer noch nicht das TextDraw wird nicht angezeigt...
    Warnings:

    C:\Users\Florian\Desktop\SAMP Server\gamemodes\Evolution.pwn(979) : warning 213: tag mismatch
    C:\Users\Florian\Desktop\SAMP Server\gamemodes\Evolution.pwn(1653) : warning 213: tag mismatch
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    2 Warnings.

    Zeilen:

    TextDrawShowForPlayer(playerid,endround[playerid]);
    PlayerTextDrawSetString(playerid,endroundTD,str);

  • TextDrawShowForPlayer(playerid,endround[playerid]);
    zu
    TextDrawShowForPlayer(playerid,endround);

  • Was genau funktioniert nicht?
    Updatet sich die Zahl nicht, oder was passiert nicht? :)

  • for(new i;i<MAX_PLAYERS;i++)
    {
    printf("ID: %d",i);
    if(IsPlayerConnected(i) && PlayerInfo[i][pAdminlevel] >= 2)
    {
    printf("ID: %d ist connected und über oder gleich Adminlevel 2: %d",i,PlayerInfo[i][pAdminlevel]);
    TextDrawShowForPlayer(i,endroundTD);
    }
    }
    Lass dir das mal debuggen. Schicke uns, wenn du das gemacht hast, den Ausdruck davon (Den Code aus der Konsole)

  • Das war in der Server Log:

    Spoiler anzeigen

    [23:26:29] [join] TheTutoFreak has joined the server (0:127.0.0.1)
    [23:26:36] ID: 0
    [23:26:36] ID: 0 ist connected und über oder gleich Adminlevel 2: 1339
    [23:26:36] ID: 1
    [23:26:36] ID: 2
    [23:26:36] ID: 3
    [23:26:36] ID: 4
    [23:26:36] ID: 5
    [23:26:36] ID: 6
    [23:26:36] ID: 7
    [23:26:36] ID: 8
    [23:26:36] ID: 9
    [23:26:36] ID: 10
    [23:26:36] ID: 11
    [23:26:36] ID: 12
    [23:26:36] ID: 13
    [23:26:36] ID: 14
    [23:26:36] ID: 15
    [23:26:36] ID: 16
    [23:26:36] ID: 17
    [23:26:36] ID: 18
    [23:26:36] ID: 19
    [23:26:36] ID: 20
    [23:26:36] ID: 21
    [23:26:36] ID: 22
    [23:26:36] ID: 23
    [23:26:36] ID: 24
    [23:26:36] ID: 25
    [23:26:36] ID: 26
    [23:26:36] ID: 27
    [23:26:36] ID: 28
    [23:26:36] ID: 29
    [23:26:36] ID: 30
    [23:26:36] ID: 31
    [23:26:36] ID: 32
    [23:26:36] ID: 33
    [23:26:36] ID: 34
    [23:26:36] ID: 35
    [23:26:36] ID: 36
    [23:26:36] ID: 37
    [23:26:36] ID: 38
    [23:26:36] ID: 39
    [23:26:36] ID: 40
    [23:26:36] ID: 41
    [23:26:36] ID: 42
    [23:26:36] ID: 43
    [23:26:36] ID: 44
    [23:26:36] ID: 45
    [23:26:36] ID: 46
    [23:26:36] ID: 47
    [23:26:36] ID: 48
    [23:26:36] ID: 49
    [23:26:36] ID: 50
    [23:26:36] ID: 51
    [23:26:36] ID: 52
    [23:26:36] ID: 53
    [23:26:36] ID: 54
    [23:26:36] ID: 55
    [23:26:36] ID: 56
    [23:26:36] ID: 57
    [23:26:36] ID: 58
    [23:26:36] ID: 59
    [23:26:36] ID: 60
    [23:26:36] ID: 61
    [23:26:36] ID: 62
    [23:26:36] ID: 63
    [23:26:36] ID: 64
    [23:26:36] ID: 65
    [23:26:36] ID: 66
    [23:26:36] ID: 67
    [23:26:36] ID: 68
    [23:26:36] ID: 69
    [23:26:36] ID: 70
    [23:26:36] ID: 71
    [23:26:36] ID: 72
    [23:26:36] ID: 73
    [23:26:36] ID: 74
    [23:26:36] ID: 75
    [23:26:36] ID: 76
    [23:26:36] ID: 77
    [23:26:36] ID: 78
    [23:26:36] ID: 79
    [23:26:36] ID: 80
    [23:26:36] ID: 81
    [23:26:36] ID: 82
    [23:26:36] ID: 83
    [23:26:36] ID: 84
    [23:26:36] ID: 85
    [23:26:36] ID: 86
    [23:26:36] ID: 87
    [23:26:36] ID: 88
    [23:26:36] ID: 89
    [23:26:36] ID: 90
    [23:26:36] ID: 91
    [23:26:36] ID: 92
    [23:26:36] ID: 93
    [23:26:36] ID: 94
    [23:26:36] ID: 95
    [23:26:36] ID: 96
    [23:26:36] ID: 97
    [23:26:36] ID: 98
    [23:26:36] ID: 99
    [23:26:36] ID: 100
    [23:26:36] ID: 101
    [23:26:36] ID: 102
    [23:26:36] ID: 103
    [23:26:36] ID: 104
    [23:26:36] ID: 105
    [23:26:36] ID: 106
    [23:26:36] ID: 107
    [23:26:36] ID: 108
    [23:26:36] ID: 109
    [23:26:36] ID: 110
    [23:26:36] ID: 111
    [23:26:36] ID: 112
    [23:26:36] ID: 113
    [23:26:36] ID: 114
    [23:26:36] ID: 115
    [23:26:36] ID: 116
    [23:26:36] ID: 117
    [23:26:36] ID: 118
    [23:26:36] ID: 119
    [23:26:36] ID: 120
    [23:26:36] ID: 121
    [23:26:36] ID: 122
    [23:26:36] ID: 123
    [23:26:36] ID: 124
    [23:26:36] ID: 125
    [23:26:36] ID: 126
    [23:26:36] ID: 127
    [23:26:36] ID: 128
    [23:26:36] ID: 129
    [23:26:36] ID: 130
    [23:26:36] ID: 131
    [23:26:36] ID: 132
    [23:26:36] ID: 133
    [23:26:36] ID: 134
    [23:26:36] ID: 135
    [23:26:36] ID: 136
    [23:26:36] ID: 137
    [23:26:36] ID: 138
    [23:26:36] ID: 139
    [23:26:36] ID: 140
    [23:26:36] ID: 141
    [23:26:36] ID: 142
    [23:26:36] ID: 143
    [23:26:36] ID: 144
    [23:26:36] ID: 145
    [23:26:36] ID: 146
    [23:26:36] ID: 147
    [23:26:36] ID: 148
    [23:26:36] ID: 149
    [23:26:36] ID: 150
    [23:26:36] ID: 151
    [23:26:36] ID: 152
    [23:26:36] ID: 153
    [23:26:36] ID: 154
    [23:26:36] ID: 155
    [23:26:36] ID: 156
    [23:26:36] ID: 157
    [23:26:36] ID: 158
    [23:26:36] ID: 159
    [23:26:36] ID: 160
    [23:26:36] ID: 161
    [23:26:36] ID: 162
    [23:26:36] ID: 163
    [23:26:36] ID: 164
    [23:26:36] ID: 165
    [23:26:36] ID: 166
    [23:26:36] ID: 167
    [23:26:36] ID: 168
    [23:26:36] ID: 169
    [23:26:36] ID: 170
    [23:26:36] ID: 171
    [23:26:36] ID: 172
    [23:26:36] ID: 173
    [23:26:36] ID: 174
    [23:26:36] ID: 175
    [23:26:36] ID: 176
    [23:26:36] ID: 177
    [23:26:36] ID: 178
    [23:26:36] ID: 179
    [23:26:36] ID: 180
    [23:26:36] ID: 181
    [23:26:36] ID: 182
    [23:26:36] ID: 183
    [23:26:36] ID: 184
    [23:26:36] ID: 185
    [23:26:36] ID: 186
    [23:26:36] ID: 187
    [23:26:36] ID: 188
    [23:26:36] ID: 189
    [23:26:36] ID: 190
    [23:26:36] ID: 191
    [23:26:36] ID: 192
    [23:26:36] ID: 193
    [23:26:36] ID: 194
    [23:26:36] ID: 195
    [23:26:36] ID: 196
    [23:26:36] ID: 197
    [23:26:36] ID: 198
    [23:26:36] ID: 199
    [23:26:36] ID: 200
    [23:26:36] ID: 201
    [23:26:36] ID: 202
    [23:26:36] ID: 203
    [23:26:36] ID: 204
    [23:26:36] ID: 205
    [23:26:36] ID: 206
    [23:26:36] ID: 207
    [23:26:36] ID: 208
    [23:26:36] ID: 209
    [23:26:36] ID: 210
    [23:26:36] ID: 211
    [23:26:36] ID: 212
    [23:26:36] ID: 213
    [23:26:36] ID: 214
    [23:26:36] ID: 215
    [23:26:36] ID: 216
    [23:26:36] ID: 217
    [23:26:36] ID: 218
    [23:26:36] ID: 219
    [23:26:36] ID: 220
    [23:26:36] ID: 221
    [23:26:36] ID: 222
    [23:26:36] ID: 223
    [23:26:36] ID: 224
    [23:26:36] ID: 225
    [23:26:36] ID: 226
    [23:26:36] ID: 227
    [23:26:36] ID: 228
    [23:26:36] ID: 229
    [23:26:36] ID: 230
    [23:26:36] ID: 231
    [23:26:36] ID: 232
    [23:26:36] ID: 233
    [23:26:36] ID: 234
    [23:26:36] ID: 235
    [23:26:36] ID: 236
    [23:26:36] ID: 237
    [23:26:36] ID: 238
    [23:26:36] ID: 239
    [23:26:36] ID: 240
    [23:26:36] ID: 241
    [23:26:36] ID: 242
    [23:26:36] ID: 243
    [23:26:36] ID: 244
    [23:26:36] ID: 245
    [23:26:36] ID: 246
    [23:26:36] ID: 247
    [23:26:36] ID: 248
    [23:26:36] ID: 249
    [23:26:36] ID: 250
    [23:26:36] ID: 251
    [23:26:36] ID: 252
    [23:26:36] ID: 253
    [23:26:36] ID: 254
    [23:26:36] ID: 255
    [23:26:36] ID: 256
    [23:26:36] ID: 257
    [23:26:36] ID: 258
    [23:26:36] ID: 259
    [23:26:36] ID: 260
    [23:26:36] ID: 261
    [23:26:36] ID: 262
    [23:26:36] ID: 263
    [23:26:36] ID: 264
    [23:26:36] ID: 265
    [23:26:36] ID: 266
    [23:26:36] ID: 267
    [23:26:36] ID: 268
    [23:26:36] ID: 269
    [23:26:36] ID: 270
    [23:26:36] ID: 271
    [23:26:36] ID: 272
    [23:26:36] ID: 273
    [23:26:36] ID: 274
    [23:26:36] ID: 275
    [23:26:36] ID: 276
    [23:26:36] ID: 277
    [23:26:36] ID: 278
    [23:26:36] ID: 279
    [23:26:36] ID: 280
    [23:26:36] ID: 281
    [23:26:36] ID: 282
    [23:26:36] ID: 283
    [23:26:36] ID: 284
    [23:26:36] ID: 285
    [23:26:36] ID: 286
    [23:26:36] ID: 287
    [23:26:36] ID: 288
    [23:26:36] ID: 289
    [23:26:36] ID: 290
    [23:26:36] ID: 291
    [23:26:36] ID: 292
    [23:26:36] ID: 293
    [23:26:36] ID: 294
    [23:26:36] ID: 295
    [23:26:36] ID: 296
    [23:26:36] ID: 297
    [23:26:36] ID: 298
    [23:26:36] ID: 299
    [23:26:36] ID: 300
    [23:26:36] ID: 301
    [23:26:36] ID: 302
    [23:26:36] ID: 303
    [23:26:36] ID: 304
    [23:26:36] ID: 305
    [23:26:36] ID: 306
    [23:26:36] ID: 307
    [23:26:36] ID: 308
    [23:26:36] ID: 309
    [23:26:36] ID: 310
    [23:26:36] ID: 311
    [23:26:36] ID: 312
    [23:26:36] ID: 313
    [23:26:36] ID: 314
    [23:26:36] ID: 315
    [23:26:36] ID: 316
    [23:26:36] ID: 317
    [23:26:36] ID: 318
    [23:26:36] ID: 319
    [23:26:36] ID: 320
    [23:26:36] ID: 321
    [23:26:36] ID: 322
    [23:26:36] ID: 323
    [23:26:36] ID: 324
    [23:26:36] ID: 325
    [23:26:36] ID: 326
    [23:26:36] ID: 327
    [23:26:36] ID: 328
    [23:26:36] ID: 329
    [23:26:36] ID: 330
    [23:26:36] ID: 331
    [23:26:36] ID: 332
    [23:26:36] ID: 333
    [23:26:36] ID: 334
    [23:26:36] ID: 335
    [23:26:36] ID: 336
    [23:26:36] ID: 337
    [23:26:36] ID: 338
    [23:26:36] ID: 339
    [23:26:36] ID: 340
    [23:26:36] ID: 341
    [23:26:36] ID: 342
    [23:26:36] ID: 343
    [23:26:36] ID: 344
    [23:26:36] ID: 345
    [23:26:36] ID: 346
    [23:26:36] ID: 347
    [23:26:36] ID: 348
    [23:26:36] ID: 349
    [23:26:36] ID: 350
    [23:26:36] ID: 351
    [23:26:36] ID: 352
    [23:26:36] ID: 353
    [23:26:36] ID: 354
    [23:26:36] ID: 355
    [23:26:36] ID: 356
    [23:26:36] ID: 357
    [23:26:36] ID: 358
    [23:26:36] ID: 359
    [23:26:36] ID: 360
    [23:26:36] ID: 361
    [23:26:36] ID: 362
    [23:26:36] ID: 363
    [23:26:36] ID: 364
    [23:26:36] ID: 365
    [23:26:36] ID: 366
    [23:26:36] ID: 367
    [23:26:36] ID: 368
    [23:26:36] ID: 369
    [23:26:36] ID: 370
    [23:26:36] ID: 371
    [23:26:36] ID: 372
    [23:26:36] ID: 373
    [23:26:36] ID: 374
    [23:26:36] ID: 375
    [23:26:36] ID: 376
    [23:26:36] ID: 377
    [23:26:36] ID: 378
    [23:26:36] ID: 379
    [23:26:36] ID: 380
    [23:26:36] ID: 381
    [23:26:36] ID: 382
    [23:26:36] ID: 383
    [23:26:36] ID: 384
    [23:26:36] ID: 385
    [23:26:36] ID: 386
    [23:26:36] ID: 387
    [23:26:36] ID: 388
    [23:26:36] ID: 389
    [23:26:36] ID: 390
    [23:26:36] ID: 391
    [23:26:36] ID: 392
    [23:26:36] ID: 393
    [23:26:36] ID: 394
    [23:26:36] ID: 395
    [23:26:36] ID: 396
    [23:26:36] ID: 397
    [23:26:36] ID: 398
    [23:26:36] ID: 399
    [23:26:36] ID: 400
    [23:26:36] ID: 401
    [23:26:36] ID: 402
    [23:26:36] ID: 403
    [23:26:36] ID: 404
    [23:26:36] ID: 405
    [23:26:36] ID: 406
    [23:26:36] ID: 407
    [23:26:36] ID: 408
    [23:26:36] ID: 409
    [23:26:36] ID: 410
    [23:26:36] ID: 411
    [23:26:36] ID: 412
    [23:26:36] ID: 413
    [23:26:36] ID: 414
    [23:26:36] ID: 415
    [23:26:36] ID: 416
    [23:26:36] ID: 417
    [23:26:36] ID: 418
    [23:26:36] ID: 419
    [23:26:36] ID: 420
    [23:26:36] ID: 421
    [23:26:36] ID: 422
    [23:26:36] ID: 423
    [23:26:36] ID: 424
    [23:26:36] ID: 425
    [23:26:36] ID: 426
    [23:26:36] ID: 427
    [23:26:36] ID: 428
    [23:26:36] ID: 429
    [23:26:36] ID: 430
    [23:26:36] ID: 431
    [23:26:36] ID: 432
    [23:26:36] ID: 433
    [23:26:36] ID: 434
    [23:26:36] ID: 435
    [23:26:36] ID: 436
    [23:26:36] ID: 437
    [23:26:36] ID: 438
    [23:26:36] ID: 439
    [23:26:36] ID: 440
    [23:26:36] ID: 441
    [23:26:36] ID: 442
    [23:26:36] ID: 443
    [23:26:36] ID: 444
    [23:26:36] ID: 445
    [23:26:36] ID: 446
    [23:26:36] ID: 447
    [23:26:36] ID: 448
    [23:26:36] ID: 449
    [23:26:36] ID: 450
    [23:26:36] ID: 451
    [23:26:36] ID: 452
    [23:26:36] ID: 453
    [23:26:36] ID: 454
    [23:26:36] ID: 455
    [23:26:36] ID: 456
    [23:26:36] ID: 457
    [23:26:36] ID: 458
    [23:26:36] ID: 459
    [23:26:36] ID: 460
    [23:26:36] ID: 461
    [23:26:36] ID: 462
    [23:26:36] ID: 463
    [23:26:36] ID: 464
    [23:26:36] ID: 465
    [23:26:36] ID: 466
    [23:26:36] ID: 467
    [23:26:36] ID: 468
    [23:26:36] ID: 469
    [23:26:36] ID: 470
    [23:26:36] ID: 471
    [23:26:36] ID: 472
    [23:26:36] ID: 473
    [23:26:36] ID: 474
    [23:26:36] ID: 475
    [23:26:36] ID: 476
    [23:26:36] ID: 477
    [23:26:36] ID: 478
    [23:26:36] ID: 479
    [23:26:36] ID: 480
    [23:26:36] ID: 481
    [23:26:36] ID: 482
    [23:26:36] ID: 483
    [23:26:36] ID: 484
    [23:26:36] ID: 485
    [23:26:36] ID: 486
    [23:26:36] ID: 487
    [23:26:36] ID: 488
    [23:26:36] ID: 489
    [23:26:36] ID: 490
    [23:26:36] ID: 491
    [23:26:36] ID: 492
    [23:26:36] ID: 493
    [23:26:36] ID: 494
    [23:26:36] ID: 495
    [23:26:36] ID: 496
    [23:26:36] ID: 497
    [23:26:36] ID: 498
    [23:26:36] ID: 499
    [23:26:53] [part] TheTutoFreak has left the server (0:1)

  • Global im Script das:
    new endround,Text:endroundTD;
    Den Befehl und das Callback so:
    ocmd:endround(playerid,params[])
    {
    SetTimer("EndroundTimer", 1000, 1);
    endround = 60*5;
    endroundTD = TextDrawCreate(511.000000, 425.000000, "Endround 05:00");
    TextDrawBackgroundColor(endroundTD, 255);
    TextDrawFont(endroundTD, 1);
    TextDrawLetterSize(endroundTD, 0.300000, 1.000000);
    TextDrawColor(endroundTD, -1);
    TextDrawSetOutline(endroundTD, 0);
    TextDrawSetProportional(endroundTD, 1);
    TextDrawSetShadow(endroundTD, 1);
    TextDrawSetSelectable(endroundTD, 0);
    for(new i = 0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    TextDrawShowForPlayer(i,endroundTD);
    }
    }
    SendClientMessageToAll(-1,"SERVER: In 5 Minuten wird der Server neu gestartet.");
    return 1;
    }
    forward EndroundTimer();
    public EndroundTimer()
    {
    endround --;
    new str[16];
    format(str, sizeof(str), "Endround %02d:%02d", endround/60, endround%60);
    for(new i;i<MAX_PLAYERS;i++)
    {
    if(!IsPlayerConnected(i))continue;
    TextDrawSetString(endroundTD,str);
    }
    if(endround == 0)SendRconCommand("gmx");
    return 1;
    }
    So funktioniert das bei mir.

  • Bei mir schon. Das TextDraw ist unten Rechts.
    Mach mal ein Screenshot oder so, denn normalerweise sollte das funktionieren.

  • Wie viele TextDraws benutzt du?
    Schick mir mal alle Arrays von allen TextDraws die du verwendest, vielleicht hast du das Limit erreicht.